April 2020
Beginner
316 pages
8h 20m
English
Modifiers in SwiftUI are a simple yet effective way of rendering custom interactions and decoration. Let's take our previous example, add some basic modifiers, and see what we get:
struct ContentView: View { var body: some View { List { Text("Learn SwiftUI") .bold() } }}
As you can see, we've added the .bold() modifier to our Text label, which does exactly what it says on the tin – it's made our text bold. It doesn't just stop there, though: as expected, you can add multiple modifiers to a View by simply chaining them together. Update your boilerplate code with the following to see the effect this has:
struct ContentView: View { var body: some View { List { Text("Hello World") .bold() .foregroundColor(.blue) .blur(radius: 1, opaque: ...Read now
Unlock full access