allow fetching from HCD

This commit is contained in:
John Rommel Estropia
2015-02-21 21:48:08 +09:00
parent 061a863235
commit f6ced13577
10 changed files with 137 additions and 32 deletions

View File

@@ -114,28 +114,3 @@ public struct HardcoreData {
private static var defaultStackInstance: DataStack?
}
extension HardcoreData {
/**
Using the defaultStack, begins a transaction asynchronously where NSManagedObject creates, updates, and deletes can be made.
:param: closure the block where creates, updates, and deletes can be made to the transaction. Transaction blocks are executed serially in a background queue, and all changes are made from a concurrent NSManagedObjectContext.
*/
public static func performTransaction(closure: (transaction: DataTransaction) -> Void) {
self.defaultStack.performTransaction(closure)
}
/**
Using the defaultStack, begins a transaction asynchronously where NSManagedObject creates, updates, and deletes can be made.
:param: closure the block where creates, updates, and deletes can be made to the transaction. Transaction blocks are executed serially in a background queue, and all changes are made from a concurrent NSManagedObjectContext.
:returns: a SaveResult value indicating success or failure, or nil if the transaction was not comitted synchronously
*/
public static func performTransactionAndWait(closure: (transaction: DataTransaction) -> Void) -> SaveResult? {
return self.defaultStack.performTransactionAndWait(closure)
}
}