From the course: iPadOS 13 Development Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Using SwiftUI to create navigation

Using SwiftUI to create navigation - iOS Tutorial

From the course: iPadOS 13 Development Essential Training

Start my 1-month free trial

Using SwiftUI to create navigation

- [Instructor] Let's say you wanted to use SwiftUI to create a navigation view, with a list of items, and you tap an item, and go to the detail view for that particular item. With SwiftUI, this is much simpler than it is and doing with code, without SwiftUI. So I'm going to delete what I have here, my VStack, and I'm going to create a navigation view in here. And to do that, I'm simply going to hit the plus button, and then go into the library, and this item all the way on the left, and then type, the view that I want to grab, which is navigation view. Click and drag that into your code, where you want it, and here it creates a navigation view, and that has this navigation link object. So it's going to need some kind of destination view. So let's create a new struct called Detail View, and it's going to inherit from view. So, if you hit that fix it button, you're going to be asked if you want to add protocol stubs. Now…

Contents