UIBarButtonItem

@_spi(FW) extension UIBarButtonItem

UIBarButtonItem+Block

  • 使用指定对象和事件创建Item,支持UIImage|NSString|NSNumber|NSAttributedString等

    Declaration

    Swift

    public static func fw_item(object: Any?, target: Any?, action: Selector?) -> Self
  • 使用指定对象和句柄创建Item,支持UIImage|NSString|NSNumber|NSAttributedString等

    Declaration

    Swift

    public static func fw_item(object: Any?, block: ((UIBarButtonItem) -> Void)?) -> Self
  • 自定义标题样式属性,兼容appearance,默认nil同系统

    Declaration

    Swift

    public var fw_titleAttributes: [NSAttributedString.Key : Any]? { get set }
  • 设置当前Item触发句柄,nil时清空句柄

    Declaration

    Swift

    public func fw_setBlock(_ block: ((UIBarButtonItem) -> Void)?)