You have created the Core Data entities required to save reviews and photos, and you have created the corresponding model objects. Now, you will create a CoreDataManager class that will set up the Core Data components for your app. Perform the following steps:
- Right-click the Core Data folder inside 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: CoreDataManager
- Subclass: NSObject
- Also create XIB: Greyed out
- Language: Swift
- Then, click Next
- Click Create. CoreDataManager.swift appears in the Project navigator.
- Add the following code after the import statement:
import CoreData
This gives you access to ...