April 2020
Beginner
316 pages
8h 20m
English
Another benefit to this approach that is that we can house most of our navigation logic inside our ContentView(), away from our other views. In fact, we can actually remove a lot of the NavigationViews we used previously and tidy up our code a little.
First, we'll start by bringing NavigationBarButtonItems into ContentView(). Make the following highlighted changes:
ListView(filter: $filter, showAddRecipe: $showAddRecipe) .navigationBarTitle(Text(""), displayMode: .inline) // Hack! .navigationBarItems(leading: HStack { Button(action: { self.showMap.toggle() }) { Image(systemName: "map") .renderingMode(.original) }.sheet(isPresented: $showMap) { RecipeMapView(filter: self.$filter) } Button(action: { self.filter ...Read now
Unlock full access