Swift Tinted Button Extension
A small Swift extension for tinting UIButton, like a UIBarButtonItem or a UINavigationItem.
Based on this.
Installation
CocoaPods:
Swift 3.0: pod 'SwiftTintedButtonExtension', '0.3.0' Swift 4.0: pod 'SwiftTintedButtonExtension', '~> 0.4.0'
Manual:
Copy SwiftTintedButtonExtension.swift to your project.
Using
self.button.setImageTintColor(UIColor.yellowColor(), state: .Normal) self.button.setImageTintColor(UIColor.blueColor(), state: .Highlighted)
License
SwiftTintedButtonExtension is available under the MIT license. See the LICENSE file for more info.