Skip to content

An Example showcasing how to use CoreData within an MVVM structure with SwiftUI

Notifications You must be signed in to change notification settings

santi-g-s/CoreDataExample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CoreDataExample

Note: I have a new example coming out soon with a more streamlined solution. Stay tuned

This project serves to present a 'bare-bones' implementation of Core Data and MVVM in SwiftUI.

The 3 binding principles which I wanted to follow when creating this are:

  1. Views should have absolutely no idea of CoreData or NSManagedObjects
  2. A DataManager class should be the one source of truth for all stored data, a singleton of this should be passed into ViewModels
  3. You should be able to UnitTest and use previews freely and independently from the DataManager class

Please feel free to comment on your tips, feedback, questions or anything else related.

Acknowledgments

About

An Example showcasing how to use CoreData within an MVVM structure with SwiftUI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages