Reputation: 489
I want to access to CoreData without UIApplication.sharedApplication() because I want to manage CoreData from Extension and Application. For example I don't want to use:
var appDel:AppDelegate = (UIApplication.sharedApplication().delegate as AppDelegate)
var context:NSManagedObjectContext = appDel.managedObjectContext!
But use something without UIApplication...
Thank you !
Upvotes: 0
Views: 514
Reputation: 2762
I would simply make it so that the App Delegate doesn't own the managed object context. I know that the auto generated core data code does this, but I feel like its bad form to marry core data to your app delegate.
Upvotes: 2