SCPCancelable

Objective-C


@interface SCPCancelable : NSObject

Swift

class Cancelable : NSObject

An object representing an action that can be canceled.

  • Indicates whether the command has completed. After the command has completed, subsequent calls to cancel will fail.

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL completed;

    Swift

    var completed: Bool { get }
  • Attempts to cancel the action in progress. If the action could not be canceled, e.g. it has already completed, the completion block will be called with an error. Otherwise, the completion block will be called with nil.

    Declaration

    Objective-C

    - (void)cancel:(nonnull SCPErrorCompletionBlock)completion;

    Swift

    func cancel(_ completion: @escaping ErrorCompletionBlock)