documentation for iCloud methods

This commit is contained in:
John Rommel Estropia
2016-04-30 01:20:35 +09:00
parent 3fe9e4ee1d
commit 0bbb4118a1
5 changed files with 204 additions and 75 deletions

View File

@@ -60,24 +60,36 @@ internal extension NSPersistentStoreCoordinator {
}
@nonobjc
internal func performSynchronously(closure: () -> Void) {
internal func performSynchronously<T>(closure: () -> T) -> T {
var result: T?
#if USE_FRAMEWORKS
self.performBlockAndWait(closure)
self.performBlockAndWait {
result = closure()
}
#else
if #available(iOS 8.0, *) {
self.performBlockAndWait(closure)
self.performBlockAndWait {
result = closure()
}
}
else {
self.lock()
autoreleasepool(closure)
autoreleasepool {
result = closure()
}
self.unlock()
}
#endif
return result!
}
@nonobjc