From the course: iOS 17 Development Essential Training

Unlock this course with a free trial

Join today to access over 22,700 courses taught by industry experts.

Displaying and dismissing popover views

Displaying and dismissing popover views

From the course: iOS 17 Development Essential Training

Displaying and dismissing popover views

- [Instructor] Another type of screen that we can show is a popover view. So that's where the view slides up from the bottom. So in order to do that, you need to do something called create a sheet and present it. One of the requirements for presenting a popover view is to have a state variable. So we'll go ahead and use that state property wrapper and then we'll call this var isPresenting, and then we'll initialize it to false. So if this value is true, we should see the popover. If it's false, we should not see it. Then we'll go down inside of our navigation destination and below our text view, I'm going to create a button. And the one that we want here is title action. So the title, I'll open up a string, and we'll just type More Info. And then for action, I'll tab over and just press Return. And in here I specify what code is executed when the button is pressed. So I'm just going to set isPresenting equal to true.…

Contents