The code that enables PhotoFilterViewController to save photos is similar to the code you implemented in ReviewFormViewController for saving reviews. You will now update PhotoFilterViewController to save photos when the Save button is tapped. Do the following steps:
- Click PhotoFilterViewController.swift in the Project navigator, and add the following method inside the private extension:
func checkSavedPhoto() { if let img = self.imgExample.image { var item = RestaurantPhotoItem() item.photo = generate(image: img, ratio: CGFloat(102)) item.date = NSDate() as Date item.restaurantID = selectedRestaurantID let manager = CoreDataManager() manager.addPhoto(item) dismiss(animated: true, completion: ...