Loader

public class Loader<Input, Output> : NSObject

通用加载器,添加处理句柄后指定输入即可加载输出结果

  • 添加block加载器,返回标志id

    Declaration

    Swift

    @discardableResult
    public func append(block: @escaping (Input) -> Output?) -> String
  • 添加target和action加载器,返回标志id

    Declaration

    Swift

    @discardableResult
    public func append(target: AnyObject?, action: Selector) -> String
  • 指定标志id移除加载器

    Declaration

    Swift

    public func remove(_ identifier: String)
  • 移除所有的加载器

    Declaration

    Swift

    public func removeAll()
  • 依次执行加载器,直到加载成功

    Declaration

    Swift

    public func load(_ input: Input) -> Output?