NSObject

class NSObject : NSObjectProtocol

To import the cancellable NSObject category:

use_frameworks! pod CancelForPromiseKit/Foundation

Or cancellable NSObject is one of the categories imported by the umbrella pod:

use_frameworks! pod CancelForPromiseKit

And then in your sources:

import PromiseKit import CancelForPromiseKit

  • Warning

    Important The promise must not outlive the object under observation.

    See also

    Apple’s KVO documentation.

    Declaration

    Swift

    public func observeCC(_: PMKNamespacer, keyPath: String) -> CancellablePromise<Any?>

    Return Value

    A promise that resolves when the provided keyPath changes, or when the promise is cancelled.