Будет ли этот код сохранять цикл?(Основные данные выполняют) - PullRequest
0 голосов
/ 29 января 2019
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()
            }
        }
}

1 Ответ

0 голосов
/ 30 января 2019

Нет цикла сохранения, но этот код не имеет смысла.

...