jrodriguer / NewsApp

SwiftUI migration of Ionic news-app.
1 stars 0 forks source link

Implementing Core Data #18

Open jrodriguer opened 3 months ago

jrodriguer commented 3 months ago

Try to implement Core Data framework to storage.

Adding CoreDataManager

It is necessarily mandatory to add a Data Model.

With the Data Model and the entity in place, we can now proceed to create our CoreDataManager.

How to implement Core Data in an existing project

  1. Add data model file in your project: New file -> Core Data -> Data Model -> Next Give any name for your data model file.
  2. Create a new Swift file, give it a name related to Core Data, like CoreDataHelper, and copy and paste the following code.