In this section, we are going to learn how to pass data from the parent app straight into the watchOS app. We will do this by updating our recipe list on our watch with a recently added recipe from AddRecipeView().
When watchOS first came on the scene, passing data was a little tricky, to say the least. We first had to create an App Group that was shared by both the iOS app and the watchOS app. Here, we could persist shared UserDefaults, which could be accessed by both the parent app and the watch.
UserDefaults is a lightweight way of storing data in your projects, using a key-value approach. You can easily persist anything from String, Bool, Int, Array, or Data in your app.
With watchOS 2.0 came WatchConnectivity—a new and more effective way of sending data from our iOS app straight to our wrist.
The initial API gave us a function...