Working with text

When using Storyboards, you modify attributes of a view using the Attributes inspector. In SwiftUI, you can modify either your code or the preview. As you will see, changing the code in ContentView.swift will immediately update the preview, and modifying the preview will update the code.

Let's learn how you can modify the text view in your project. Perform the following steps:

  1. In the preview, command + click the Lets Eat text on the screen. The structured editing popover will appear. Choose Show SwiftUI Inspector...:

  1. SwiftUI Inspector appears on screen. Change the Text modifier to The Tap Trailhouse. This is the name of ...

Get iOS 13 Programming for Beginners - Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.