Delegated

public struct Delegated<Input, Output>

Provides a memory-safe way of passing callbacks around while not creating retain cycles. This file was copied from https://github.com/dreymonde/Delegated instead of added as a dependency to reduce the number of packages that ship with SwiftPhoenixClient

  • Undocumented

    Declaration

    Swift

    public init()
  • Undocumented

    Declaration

    Swift

    public mutating func delegate<Target : AnyObject>(to target: Target,
                                                      with callback: @escaping (Target, Input) -> Output)
  • Undocumented

    Declaration

    Swift

    public func call(_ input: Input) -> Output?
  • Undocumented

    Declaration

    Swift

    public var isDelegateSet: Bool { get }
  • Undocumented

    Declaration

    Swift

    public mutating func stronglyDelegate<Target : AnyObject>(to target: Target,
                                                              with callback: @escaping (Target, Input) -> Output)
  • Undocumented

    Declaration

    Swift

    public mutating func manuallyDelegate(with callback: @escaping (Input) -> Output)
  • Undocumented

    Declaration

    Swift

    public mutating func removeDelegate()

Available where Input == Void

  • Undocumented

    Declaration

    Swift

    public mutating func delegate<Target : AnyObject>(to target: Target,
                                                      with callback: @escaping (Target) -> Output)
  • Undocumented

    Declaration

    Swift

    public mutating func stronglyDelegate<Target : AnyObject>(to target: Target,
                                                              with callback: @escaping (Target) -> Output)
  • Undocumented

    Declaration

    Swift

    public func call() -> Output?

Available where Output == Void

  • Undocumented

    Declaration

    Swift

    public func call(_ input: Input)

Available where Input == Void, Output == Void

  • Undocumented

    Declaration

    Swift

    public func call()