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.

Navigation title

Navigation title

- [Instructor] While we use buttons in the view, adding buttons to a toolbar, like the navigation bar is an option to optimize space. And we'll start this with a toolbar modifier, which controls all the toolbars in a view. We add the controls to a closure within the modifier. So let's go back to where we were before, which was order detail view, and we'll stick some more code underneath here. And the first thing we'll do is just put it in the toolbar modifier itself. And that's just a closure. And then what you're going to put in here is either a toolbar item group or a toolbar item. And the one you pick is either if you're going to have more than one or one view in there. I'm going to use a toolbar item group to say that I'm using more things, although technically I'm not, you can use it for everything and like I'm going to do. And that way you don't have to keep remembering both of them. So I'll put toolbar item…

Contents