From the course: Complete Guide to SwiftUI
Unlock this course with a free trial
Join today to access over 24,700 courses taught by industry experts.
Challenge: Ratings view
From the course: Complete Guide to SwiftUI
Challenge: Ratings view
(upbeat music) - Okay, it's time for your second challenge. With what we've learned so far, we're going to make a new view called RatingsView. RatingsView will have an integer parameter that rates a menu item on a number from 1 to 6. So for example, RatingsView (rating:4) would be four filled circles and two empty circles. And you're going to use the SF Symbols circle and fork.knife.circle.fill to do this. And once you create the RatingsView, replace the description in MenuRowView with the rating. Okay, go ahead and give that a try and see what you can do.
Contents
-
-
-
-
(Locked)
Embed a stack view6m 29s
-
(Locked)
Text views3m 41s
-
(Locked)
Image views with SF Symbols5m 22s
-
(Locked)
Iteration with ForEach5m 13s
-
(Locked)
Images and assets4m 56s
-
(Locked)
Labels2m 22s
-
Add view2m 49s
-
(Locked)
Challenge: Add views26s
-
(Locked)
Solution: Add views2m 33s
-
(Locked)
Extract subviews8m 4s
-
(Locked)
Subviews with parameters6m 37s
-
(Locked)
Challenge: Ratings view44s
-
(Locked)
Solution: Ratings view3m 55s
-
(Locked)
-
-
-
-
-
-
-
-
-
-
-
-
-
-