CSSetupResult
@objc
public final class CSSetupResult : NSObject
The CSSetupResult
serves as the Objective-C bridging type for SetupResult
.
See also
SetupResult
-
YES
if adding theCSStorageInterface
to theCSDataStack
succeeded,NO
otherwise.Declaration
Swift
@objc public var isSuccess: Bool { get }
-
YES
if adding theCSStorageInterface
to theCSDataStack
failed,NO
otherwise. WhenYES
, theerror
property returns the actualNSError
for the failure.Declaration
Swift
@objc public var isFailure: Bool { get }
-
A
CSStorageInterface
instance if thecommit
operation for the transaction succeeded. Returnsnil
otherwise.Declaration
Swift
@objc public let storage: CSStorageInterface?
-
The
NSError
for a failedcommit
operation, ornil
if thecommit
succeededDeclaration
Swift
@objc public let error: NSError?
-
If the result was a success, the
success
block is executed with theCSStorageInterface
instance that was added to theCSDataStack
. If the result was a failure, thefailure
block is executed with anNSError
argument pertaining to the actual error.The blocks are executed immediately as
@noescape
and will not be retained.Declaration
Swift
@objc public func handleSuccess(_ success: (_ storage: CSStorageInterface) -> Void, failure: (_ error: NSError) -> Void)
Parameters
success
the block to execute on success. The block passes a
CSStorageInterface
instance that was added to theCSDataStack
.failure
the block to execute on failure. The block passes an
NSError
argument that pertains to the actual error. -
If the result was a success, the
success
block is executed with aBOOL
argument that indicates if there were any changes made. If the result was a failure, this method does nothing.The block is executed immediately as
@noescape
and will not be retained.Declaration
Swift
@objc public func handleSuccess(_ success: (_ storage: CSStorageInterface) -> Void)
Parameters
success
the block to execute on success. The block passes a
BOOL
argument that indicates if there were any changes made. -
If the result was a failure, the
failure
block is executed with anNSError
argument pertaining to the actual error. If the result was a success, this method does nothing.The block is executed immediately as
@noescape
and will not be retained.Declaration
Swift
@objc public func handleFailure(_ failure: (_ error: NSError) -> Void)
Parameters
failure
the block to execute on failure. The block passes an
NSError
argument that pertains to the actual error.