full inline sourcecode documentation

This commit is contained in:
John Rommel Estropia
2015-05-22 02:26:28 +09:00
parent 637829ec32
commit 8374c552f0
37 changed files with 1514 additions and 287 deletions

View File

@@ -31,16 +31,16 @@ import GCDKit
// MARK: - AsynchronousDataTransaction
/**
The AsynchronousDataTransaction provides an interface for NSManagedObject creates, updates, and deletes. A transaction object should typically be only used from within a transaction block initiated from DataStack.beginAsynchronous(_:), or from HardcoreData.beginAsynchronous(_:).
The `AsynchronousDataTransaction` provides an interface for `NSManagedObject` creates, updates, and deletes. A transaction object should typically be only used from within a transaction block initiated from `DataStack.beginAsynchronous(_:)`, or from `HardcoreData.beginAsynchronous(_:)`.
*/
public final class AsynchronousDataTransaction: BaseDataTransaction {
// MARK: Public
/**
Saves the transaction changes asynchronously. This method should not be used after the commit() method was already called once.
Saves the transaction changes asynchronously. This method should not be used after the `commit()` method was already called once.
:param: completion the block executed after the save completes. Success or failure is reported by the SaveResult argument of the block.
:param: completion the block executed after the save completes. Success or failure is reported by the `SaveResult` argument of the block.
*/
public func commit(completion: (result: SaveResult) -> Void) {
@@ -59,9 +59,7 @@ public final class AsynchronousDataTransaction: BaseDataTransaction {
}
/**
Saves the transaction changes and waits for completion synchronously. This method should not be used after the commit() method was already called once.
:returns: a SaveResult value indicating success or failure.
Saves the transaction changes and waits for completion synchronously. This method should not be used after the `commit()` method was already called once.
*/
public func commit() {
@@ -73,10 +71,10 @@ public final class AsynchronousDataTransaction: BaseDataTransaction {
}
/**
Begins a child transaction synchronously where NSManagedObject creates, updates, and deletes can be made. This method should not be used after he commit() method was already called once.
Begins a child transaction synchronously where NSManagedObject creates, updates, and deletes can be made. This method should not be used after the `commit()` method was already called once.
: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
: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 func beginSynchronous(closure: (transaction: SynchronousDataTransaction) -> Void) -> SaveResult? {
@@ -93,10 +91,10 @@ public final class AsynchronousDataTransaction: BaseDataTransaction {
// MARK: BaseDataTransaction
/**
Creates a new NSManagedObject with the specified entity type. This method should not be used after the commit() method was already called once.
Creates a new `NSManagedObject` with the specified entity type. This method should not be used after the `commit()` method was already called once.
:param: entity the NSManagedObject type to be created
:returns: a new NSManagedObject instance of the specified entity type.
:param: entity the `NSManagedObject` type to be created
:returns: a new `NSManagedObject` instance of the specified entity type.
*/
public override func create<T: NSManagedObject>(entity: T.Type) -> T {
@@ -106,10 +104,10 @@ public final class AsynchronousDataTransaction: BaseDataTransaction {
}
/**
Returns an editable proxy of a specified NSManagedObject. This method should not be used after the commit() method was already called once.
Returns an editable proxy of a specified `NSManagedObject`. This method should not be used after the `commit()` method was already called once.
:param: object the NSManagedObject type to be edited
:returns: an editable proxy for the specified NSManagedObject.
:param: object the `NSManagedObject` type to be edited
:returns: an editable proxy for the specified `NSManagedObject`.
*/
public override func fetch<T: NSManagedObject>(object: T?) -> T? {
@@ -119,9 +117,9 @@ public final class AsynchronousDataTransaction: BaseDataTransaction {
}
/**
Deletes a specified NSManagedObject. This method should not be used after the commit() method was already called once.
Deletes a specified `NSManagedObject`. This method should not be used after the `commit()` method was already called once.
:param: object the NSManagedObject type to be deleted
:param: object the `NSManagedObject` type to be deleted
*/
public override func delete(object: NSManagedObject?) {
@@ -131,7 +129,7 @@ public final class AsynchronousDataTransaction: BaseDataTransaction {
}
/**
Rolls back the transaction by resetting the NSManagedObjectContext. After calling this method, all NSManagedObjects fetched within the transaction will become invalid. This method should not be used after the commit() method was already called once.
Rolls back the transaction by resetting the `NSManagedObjectContext`. After calling this method, all `NSManagedObjects` fetched within the transaction will become invalid. This method should not be used after the `commit()` method was already called once.
*/
public override func rollback() {