UADisposable

Objective-C


@interface UADisposable : NSObject

Swift

class Disposable : NSObject

A convenience class for creating self-referencing cancellation tokens.

Note

It is left up to the creator to determine what is disposed of and under what circumstances. This includes threading and memory management concerns.

Disposable Creation

  • Create a new disposable.

    Declaration

    Objective-C

    - (nonnull instancetype)init:(nonnull void (^)(void))disposalBlock;

    Swift

    init(_ disposalBlock: @escaping () -> Void)

    Parameters

    disposalBlock

    A disposal block to be executed upon disposal.

Disposable Remove

  • Dispose of associated resources.

    Declaration

    Objective-C

    - (void)dispose;

    Swift

    func dispose()