Using our mock data

With that done, let's inject some mock data into our app. The good news is that we can reuse our Helper.mockData() class from our main app; head on over to Helper.swift and highlight the file.

We're going to want to include this as part of our My Favourite Recipes Watch Extension project, so similar to what we did with RecipeDetail(), select the File Inspector in the right-hand column of Xcode, take note of the Target Membership section, and check My Favourite Recipes Watch Extension.

Go ahead and try and press command + B to build the app. You'll notice that the following errors are thrown up:

That's because our Helper ...

Get Learn SwiftUI now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.