0
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()
            }
        }
}
Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
infiniteLoop
  • 2,135
  • 1
  • 25
  • 29

1 Answers1

0

No retain cycle, but this code makes no sense.

trapper
  • 11,716
  • 7
  • 38
  • 82