Open lolgear opened 7 years ago
works:
func setup() {
// pass scheme name to it.
guard let bundle = Bundle(identifier: "com.opensource.Database") else {
return
}
guard let databaseUrl = bundle.url(forResource: "Database", withExtension: "momd") else {
return
}
guard let stack = MagicalRecord.setupAutoMigratingStack() else {
return
}
stack.model = NSManagedObjectModel(at: databaseUrl)
stack.coordinator = stack.createCoordinator(options: nil)
}
nope :/
It is a swift time today. All parts of app are supposed to be 'frameworkable', because 'targets' should be 'cleaned' from massive view controllers and other code.
Database embedded from not an exception in this world. All models live in separated framework ( Database.framework, for example ). And also xcdatamodel lives with them.
What is the point? How to setup this kind of stack?
I ended up with this:
But it doesn't work.