- Let's continue working in our demo to build our Todo app.
- Create a new Group in Xcode called Model to add the model classes inside.
- Create a new class called AbstractManager to work as a parent manager for the TasksListsManager and the TasksManager classes that we will create.
- Add the following code in the AbstractManager class:
import UIKit import CoreData class AbstractManager: NSObject { /// The managedObjectContext for core data. lazy var managedObjectContext: NSManagedObjectContext = { let app = UIApplication.shared.delegate as! AppDelegate return app.persistentContainer.viewContext }() }
- Add a new class called TasksListManager with a subclass of AbstractManager. Add the following code in TasksListManager.swift