extension NSManagedObject{
/// Perform on main context asynchrounously
/// SaveContext will be called after the block() is executed
/// - Parameter block: The blcok of code passing context as param
class func performOnMainContext(_ block:@escaping ClosureTypes.managedObjectContextClosure){
let context:NSManagedObjectContext! = appDataController().mainContext()
context.perform {
block(context)
context.saveContext()
}
}
}
Asked
Active
Viewed 57 times
0

Jonathan Leffler
- 730,956
- 141
- 904
- 1,278

infiniteLoop
- 2,135
- 1
- 25
- 29
1 Answers
0
No retain cycle, but this code makes no sense.

trapper
- 11,716
- 7
- 38
- 82
-
Thanks for confirming! – infiniteLoop Jan 30 '19 at 15:24