ObserverCancellable

public final class ObserverCancellable

An object that provieds action based cancelation. When cancel method is called or the object is deallocated, cancel action will be called.

  • Creates an observer cancellable with a cancel action

    Declaration

    Swift

    public init(_ cancel: @escaping () -> Void)

    Parameters

    cancel

    A cancel action that will be called on cancel or the object deallocation

  • Calls underlying cancel action

    Declaration

    Swift

    public func cancel()