From the course: iOS 17 Development Essential Training

Unlock this course with a free trial

Join today to access over 24,000 courses taught by industry experts.

Creating detail views

Creating detail views

- [Instructor] Often when you see this type of list in iOS, you're able to tap on an item and go to a different view. Let's take a look at how that works in our application. Under our navigationTitle, inside of the NavigationStack, and below the list, I'm going to create a new line, and then type .navigationDestination. The one that I want to choose is for destination. So this asks for a hashable protocol. Remember, our data model is hashable, and the value that's going to be coming in when it's selected is a day. So here, if you put Day.self, you can tab over to the hashable value here, and then just press return, replace hashable with the word day all lowercase. And that's going to work just like it does here for our list. So whenever a destination is selected, or whenever one of these items in the list is tapped, we're going to show the view that we place inside of here. So let's start with simple text. So open up a…

Contents