SwiftUI Journey Part 10: Settings
I can’t believe how easy it is to implement a settings page in SwiftUI. For the UI, I only need 37 lines.
Of course, this implementation won’t be accepted by the programming gods. Why you may ask. This is implemented in a static way. What if you want to turn every Text()
background to Color.yellow
. Then you will have to add the modifier background to every Text()
view.
Let’s make it dynamic.
Ah much better.