April 2020
Beginner
316 pages
8h 20m
English
Now that we've got our navigation bar all set up, let's look at how we add a button to it.
First of all, let's head back over to ContentView.swift. We're going to add a modifier called navigationBarButtonItems—for those who have worked with UINavigation controls previously, this will suddenly feel like familiar territory. Adding a navigation bar button item to your Navigation View allows you to add Views (anything from images, to text, to buttons) to the top navigation bar in your app.
Although not set in stone, adding a button that presents another View often leads to a View being presented modally as opposed to being added and pushed along the Navigation Views stack. Let's implement the following just ...
Read now
Unlock full access