From the course: iOS Development Tips

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

SwiftUI labels

SwiftUI labels

- [Instructor] One new view in Swift UI can also be a great example of a Swift 5.3 feature. And that's a label. Labels combine an image and text into a single view. Now if you check out the exercise file, we have a way of doing that already. which is of course an HStack, which I got right here. Now a simple label. We can change this to this. And that's just, we put a label, and we have two parameters. The first one is our text. As a title. And the second one is an icon or image. And I'm going to use system image. So I use an SF symbol. And I'm going to use to use hand raised fill. And you can see that does the same thing. We just changed it to a fill instead of a unfilled hand. Again, I can use image here if I wanted to use something from the asset library. However, label can also have closures for title and icon. So I can make the label like this. Or I can type Label, put some parentheses. And inside of here…

Contents