From the course: Programming for Non-programmers: iOS 17 and Swift 5
Unlock this course with a free trial
Join today to access over 24,800 courses taught by industry experts.
Challenge: Create the value text view
From the course: Programming for Non-programmers: iOS 17 and Swift 5
Challenge: Create the value text view
- [Instructor] And now for this chapter's challenge. In this chapter, we discussed working with variables in SwiftUI. As we discussed previously, variables and constants are named containers that hold some type of data. They can be used in SwiftUI as well. We discussed SwiftUI stacks, grids, attributes, and working with custom components. The challenge for this chapter is to finish the UI by creating the total text field. So right now we have dummy text on the screen, and we want to create a custom component called TotalText. You'll need to style the component, changing the font size, and any other attributes you choose. I also want you to create an attribute called Value and have that value be passed from the main content view into the TotalText view. This challenge should take about 10 minutes to complete. Good luck.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
SwiftUI layout basics2m 57s
-
(Locked)
Creating custom SwiftUI components1m 57s
-
(Locked)
Creating calculator buttons4m 50s
-
(Locked)
Setting button text2m 41s
-
(Locked)
Setting button width2m 33s
-
(Locked)
Setting button colors2m 2s
-
(Locked)
Challenge: Create the value text view1m
-
(Locked)
Solution: Create the value text view4m 16s
-
(Locked)
-
-
-
-