April 2020
Beginner
316 pages
8h 20m
English
With SwiftUI, this is one of the easiest things to implement in watchOS, especially compared to the original way of doing it.
Previously, you would set up a custom segue in your storyboard, then implement a delegate method to detect a tap on a row, and then wrap up the data you wanted to pass over into a dictionary, followed by unwrapping at the other end. It's nothing too difficult—just tedious.
Now, with SwiftUI, we can fix this with one simple little wrapper that you've already seen before. Take a look, and make the following highlighted changes in your ContentView() struct:
VStack { Text("Recipes") .font(.headline) List(recipes, id: \.id) { recipe in NavigationLink(destination: IngredientsView(ingredients: recipe.ingredients, ...Read now
Unlock full access