# CSSetupResult Class Reference

# CSSetupResult

    @objc
    public final class CSSetupResult : NSObject

The `CSSetupResult` serves as the Objective-C bridging type for `SetupResult`.

See also

`SetupResult`

- `isSuccess`

  `YES` if adding the `CSStorageInterface` to the `CSDataStack` succeeded, `NO` otherwise.

  #### Declaration

  Swift

      @objc
      public var isSuccess: Bool { get }

- `isFailure`

  `YES` if adding the `CSStorageInterface` to the `CSDataStack` failed, `NO` otherwise. When `YES`, the `error` property returns the actual `NSError` for the failure.

  #### Declaration

  Swift

      @objc
      public var isFailure: Bool { get }

- `storage`

  A `CSStorageInterface` instance if the `commit` operation for the transaction succeeded. Returns `nil` otherwise.

  #### Declaration

  Swift

      @objc
      public let storage: CSStorageInterface?

- `error`

  The `NSError` for a failed `commit` operation, or `nil` if the `commit` succeeded

  #### Declaration

  Swift

      @objc
      public let error: NSError?

- `handleSuccess(_:failure:)`

  If the result was a success, the `success` block is executed with the `CSStorageInterface` instance that was added to the `CSDataStack`. If the result was a failure, the `failure` block is executed with an `NSError` 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 the `CSDataStack`.
  `failure` | the block to execute on failure. The block passes an `NSError` argument that pertains to the actual error.

- `handleSuccess(_:)`

  If the result was a success, the `success` block is executed with a `BOOL` 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.

- `handleFailure(_:)`

  If the result was a failure, the `failure` block is executed with an `NSError` 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.