Swift Tinted Button Extension
一个用于着色 UIButton 的 Swift 扩展,例如 UIBarButtonItem 或 UINavigationItem。
基于 这个。
安装
CocoaPods
Swift 3.0: pod 'SwiftTintedButtonExtension', '0.3.0' Swift 4.0: pod 'SwiftTintedButtonExtension', '~> 0.4.0'
手动
Copy SwiftTintedButtonExtension.swift to your project.
使用
self.button.setImageTintColor(UIColor.yellowColor(), state: .Normal) self.button.setImageTintColor(UIColor.blueColor(), state: .Highlighted)
许可证
SwiftTintedButtonExtension 是在 MIT 许可证下可用的。有关更多信息,请参阅 LICENSE 文件。