April 2020
Beginner
316 pages
8h 20m
English
Still in ContentView.swift, locate the navigation bar button items we created earlier. Remember how we added an HStack on the leading button for later? Well, this is later, so add in the following highlighted changes to add another button to our leading items:
.navigationBarItems(leading: HStack { Button(action: { self.showMap.toggle() }) { Image(systemName: "map") .renderingMode(.original) }.sheet(isPresented: $showMap) { RecipeMapView(filter: self.$filter) } Button(action: { self.filter = "" }) { Image(systemName: "line.horizontal.3.decrease.circle") .renderingMode(.original) } }, trailing: Button(action: { self.showAddRecipe.toggle() }) { Image(systemName: "plus") .renderingMode(.original) }.sheet(isPresented: ...Read now
Unlock full access