CoreData Swift: How to save and load data? — swift 5.2

iKh4ever
2 min readMay 23, 2020

--

Core Data

Persist or cache data and support undo on a single device.

Use Core Data to save your application’s permanent data for offline use, to cache temporary data, and to add undo functionality to your app on a single device.

Through Core Data’s Data Model editor, you define your data types and relationships and generate respective class definitions. Core Data can then manage object instances at runtime to provide the following features.

Persistence

Core Data abstracts the details of mapping your objects to a store, making it easy to save data from Swift and Objective-C without administering a database directly.

Undo and Redo of Individual or Batched Changes

Core Data undo manager tracks changes and can roll them back individually, in groups, or all at once, making it easy to add undo and redo support to your app.

Background Data Tasks

Perform potentially UI-blocking data tasks, like parsing JSON into objects, in the background. You can then cache or store the results to reduce server roundtrips.

View Synchronization

Core Data also helps keep your views and data synchronized by providing data sources for table and collection views.

Versioning and Migration

Core Data includes mechanisms for versioning your data model and migrating user data as your app evolves.

Below is Basic Example for Save and load data from Core Data

Discord: https://discord.gg/Ge2ppVf

Facebook Page: https://goo.gl/W8Vjnu

Youtube Channel: https://goo.gl/TBOEWO

Website:https://www.ikh4ever.com/

Twitter: https://twitter.com/ikh4ver

--

--

No responses yet