3 ways of styling SwiftUI views
Published in
4 min readMay 24, 2021
Styling a view is the most important part of building beautiful user interfaces. When it comes to the actual code syntax, we want reusable, customizable and clean solutions in our code.
This article will show you these 3 ways of styling a SwiftUI.View
:
- Initializer-based configuration
- Method chaining using return-self
- Styles in the Environment
As a general rule of thumb, any approach is viable. In the end, it comes down to your general code-style guidelines and personal…