Make Your Own SwiftUI Modifier

Text(“+”)

Becomes →

Text(“+”)

.myCustomStyle()

Here is how:

  1. The public function can be further customized by passing in parameters.
  2. multiple public functions can reside in an “extension View” library. This makes it easier to customize the appearance of the app all in one place. Consequently removing the many / most of the styling info from the logic of the code into a separate file — functions as a “style sheet” library.

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Codable in iOS

Change Status bar color for non-UINavigationBar iOS

Clipping in Flutter

RxSwift / RxCocoa: Intro to Traits

Ordering Element in iOS

Serum DEX user guide — MathWallet

print() vs dump()

What are the Benefits of Providing Liquidity on QuickSwap DEX?

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Andrew Ho

Andrew Ho

More from Medium

Review of Crypto-Token Zero-Layer 17th Feb 2022

Public.com and Iskra Lawrence launch InPower

Presentation on Game Idea — Week 3

4 Incredible Examples of Green Architecture from around the World