Loading Images from the ImageStore
Now that the ImageStore can store images, and instances of Item have a key to get an image (Figure 15.9), you need to teach DetailViewController how to grab the image for the selected Item and place it in its imageView.
The DetailViewController’s view will appear when the user taps a row in ItemsViewController and when the UIImagePickerController is dismissed. In both of these situations, the imageView should be populated with the image of the Item being displayed. Currently, it is only happening when the UIImagePickerController is dismissed.
In DetailViewController.swift, look for and display images in viewWillAppear(_:).
Listing 15.23 Retrieving the image from the ImageStore (DetailViewController.swift ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access