Understanding how saving and loading works

Open the Misc folder in your project, and open the JSON folder. If you click on any one of the JSON files inside, you'll see that each restaurant is uniquely identified by a numeric identifier. For example, the identifier for The Tap Trailhouse is 145237, as shown in the screenshot below:

When you save photos and reviews to Core Data, you will save them together with this identifier. Then, when a particular restaurant is displayed in the Restaurant Detail screen, RestaurantDetailViewController will use the identifier to search for reviews and photos of that restaurant and display them in collection views, as shown in the screenshot:

If there are no reviews or photos, you'll use the NoDataView to inform the user there are no reviews or photos, as shown in the screenshot:

You'll need a way to store the restaurant identifier. To do so, you will modify RestaurantItem with an additional property to store restaurant identifiers, which can then be used to get reviews and photos for that particular restaurant.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.233.72