Clean-Swift / CleanStore

A sample iOS app built using the Clean Swift architecture. Clean Swift is Uncle Bob's Clean Architecture applied to iOS and Mac projects. CleanStore demonstrates Clean Swift by implementing the create order use case described by in Uncle Bob's talks.
https://clean-swift.com/clean-swift-ios-architecture/
MIT License
1.91k stars 316 forks source link

CoreData not working? #10

Open felipecaldas opened 8 years ago

felipecaldas commented 8 years ago

Hi Ray,

I am using your code as basis for my own and struggling here with CoreData. My CoreData DataStore class, has the very same init() method with everything you have in your CleanStore project and the AppDelegate has no references to CoreData. The init() method is invoked and throws no exception. I can query the DB, insert and update. No exceptions thrown. But, the data is not actually inserted in the DB.

Have you experienced that? Thanks

felipecaldas commented 8 years ago

My AppDelegate injects the repository:

let container = Container() { c in c.register(UserDataStore.self) { _ in ParseRepository() } //If I ever want to change Parse to something else (example, Firebase) then this is the place I change to a new repo c.register(GenericRepository.self) { r in GenericRepository(_userDataStore: r.resolve(UserDataStore.self)!) } }

not sure if this has to do with anything.