You have created the Core Data entities required to save reviews and photos, the corresponding model objects for those entities, and a CoreDataManager class that will set up the Core Data components for your app.
Now, you will create a ReviewDataManager class to interface between Core Data and the rest of your app. This is similar to the way ExploreDataManager acts as an interface between ExploreData.plist and the rest of your app. Perform the following steps:
- Right-click the Misc folder and choose New File.
- iOS should already be selected. Choose Cocoa Touch Class and then click Next.
- Configure the file as follows:
- Class: ReviewDataManager
- Subclass: NSObject
- Also create XIB: Unchecked
- Language: Swift
- Then, click Next
- Click Create. ReviewDataManager.swift appears in the Project navigator.
- Modify the file as shown:
import UIKit
class ReviewDataManager...