Updating the PhotoFilterViewController class to save photos
The code that enables the PhotoFilterViewController
class to save photos to the persistent store is similar to the code you implemented in the ReviewFormViewController
class for saving reviews. You will now update the PhotoFilterViewController
class to save photos when the Save button is tapped. Follow these steps:
- Click
PhotoFilterViewController.swift
in the Project navigator and add the following method inside theprivate
extension after theinitialize()
method:func checkSavedPhoto() { if let img = self.imgExample.image { var item = RestaurantPhotoItem() item.photo = generate(image: img, ratio: CGFloat(102)) item.date = Date() item.restaurantID = selectedRestaurantID ...