April 2020
Beginner
316 pages
8h 20m
English
We've covered the Text() object in a couple of chapters now, but there is so much more to show, so let's head straight back to the code that we left in Chapter 4, Creating Your First Application:
var body: some View { VStack { List(recipeNames, id: \.self) { name in Text("\(name)") } } }
As we can see, the Text View is just a basic control (along with a string being interpolated). Let's start by making some small amendments; then we can see what options are available to us. For the next code snippet, we'll just focus on the Text object for now:
Text("\(name)") .font(.headline)
Directly after the Text object, press Enter and then type .font(.headline). Here, we are adding a font modifier to our object and passing in a pre-defined ...
Read now
Unlock full access