April 2020
Beginner
316 pages
8h 20m
English
Okay, so we are going to add our MapView to the ContentView() of our app; we'll take the same approach as we did with the AddRecipeView() by adding this to our navigation bar button item. Head on over to ContentView.Swift now and make the following highlighted change:
.navigationBarItems(leading: HStack { Button(action: { self.showMap.toggle() }) { Image(systemName: "map") .renderingMode(.original) }.sheet(isPresented: $showMap) { RecipeMapView() }}, trailing: Button(action: { self.showAddRecipe.toggle() }) { Image(systemName: "plus") .renderingMode(.original) }.sheet(isPresented: $showAddRecipe) { AddRecipeView().environmentObject(self.appData) })
As you can see from the preceding code block, the noticeable difference ...
Read now
Unlock full access