All that remains is to write the body of the view, and the only interesting thing here is that without @FetchRequest we need to read the wrappedValue property of fetchRequest to pull out our data. This tutorial is the 5th part of the series of the creation of a To-do list app. Define a class CoreDataHelper and add a conformance to DBHelperProtocol. Certificates/Awards. In Attributes, let’s add three attributes: uuid, title and isCompleted with types UUID, String, Bool accordingly. The issue is that the app doesn’t have a persistent storage for its data. In Core Data, I have two entities: a Task and a Person, with a many-to-many relationship between both (i.e., a person can be assigned to multiple tasks, and a task has multiple assigned persons). You can name your project however you want, for instance, “PizzaRestaurant”. This means when we use %@ for the attribute name we might end up with a predicate like this: And that’s not correct: the attribute name should not be in quote marks. Like I said, this is also going to have two buttons that lets us change the way the view is filtered, and we’re going to have an extra button to insert some testing data so you can see how it works. In the beginning, we have an app written with SwiftUI and Combine. Also, it is helpful if we decide to add tests to our app (and we should do it in a real project), since we’ll be able to substitute our data helper with a mock one for our unit tests. August 10, 2020. Also, import our DBHelper adding import DBHelper below. One last step here. This will insert values we provide, but won’t add quote marks around them. But, fortunately, we created a protocol for our DataManager there that stores all the data in an array, so we can replace it with another one and implement a persistent storage touching no other parts of the project. I know it’s irritating but let it leave as it is for now. About You should see our List dynamically update with different data, depending on which button you press. It uses Protocols and MVVM. Next step is to create a model file for our database. Requirement: Creating the Core Data Stack using NSPersistentCloudKitContainer instead of NSPersistentContainer. 90%.