From the course: iOS 14 Development Essential Training
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Displaying and dismissing popover views
From the course: iOS 14 Development Essential Training
Displaying and dismissing popover views
- [Teacher] Another common view in iOS development is the popover view or sheet. Let's take a look at how to add those using Swift UI. Now for what we're doing here we're going to make changes in the detail view. Let's take our text object. We're going to wrap that in a vstack so we'll go like that. It's just vstack and then curly braces above and below the text object and then I'm going to indent so it's easier to read. Now below that text let's add a button capital B, open up the parentheses and the one that you want is title and action. So choose that. Let's put the title in as a string. So open up the quotes there. We can just call this button or better yet show popover and then for the action I'm going to just highlight where it says void and then tap return to have X code fill that in for me and I'm going to press backspace to empty that out. So now we have our detail one show…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.