UADisposable

@interface UADisposable : 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.
  • Create a new disposable.

    Declaration

    Objective-C

    + (nonnull instancetype)disposableWithBlock:
        (nonnull UADisposalBlock)disposalBlock;

    Swift

    convenience init(block disposalBlock: @escaping UADisposalBlock)

    Parameters

    disposalBlock

    A UADisposalBlock to be executed upon disposal.

  • Dispose of associated resources.

    Declaration

    Objective-C

    - (void)dispose;

    Swift

    func dispose()