From the course: Complete Guide to SwiftUI
Unlock this course with a free trial
Join today to access over 24,900 courses taught by industry experts.
Deeper navigation stacks
From the course: Complete Guide to SwiftUI
Deeper navigation stacks
- [Instructor] You've seen a simple case of a navigation stack to a single view, which is something you can do with a sheet. Where navigation stacks come to their own is with more than one view in navigation. I'm going to add one more feature to the menu item view, a random suggestion for another pizza. This will simulate one of those "You Might Like" views you find in many shopping apps. So let's go to menu item view to start this, and I can get rid of the preview for the moment So we have plenty of room to work. and I'm going to add at the top, a declaration, state private var. We'll put a suggested item in here, and that's going to be a menu item. And we're going to assign that from a menu model, and that'll be a menu. And we're going to use a random element that needs to be unwrapped. So I'm going to go ahead and do this. No menu item. And that gives us a random item to play with. Now we're going to go to the…
Contents
-
-
-
-
-
-
-
-
-
-
-
-
- (Locked) Navigation links3m 57s
- (Locked) Stack navigation in lists5m 58s
- (Locked) Deeper navigation stacks4m 47s
- (Locked) Create navigation paths4m 1s
- (Locked) Use navigation paths6m 7s
- (Locked) More navigation destinations4m 26s
- Toolbars4m 15s
- (Locked) Navigation title5m 22s
- (Locked) List interaction2m 53s
- (Locked)
-
-
-
-
-