3 ways of styling SwiftUI views

Philip Niedertscheider
Level Up Coding
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:

  1. Initializer-based configuration
  2. Method chaining using return-self
  3. 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…

--

--

Changing the status quo of iOS & macOS development | Self-Taught | Co-Founder/CTO @techprimate | Follow me on Twitter @philprimes for updates 🚀