Developer Tools Swift Tool Belt, Part 8: Extending UIButton with Background Color for State This extension adds a bit of functionality that's missing from UIButton in Swift—adding the ability to set the background color for different button states.
Developer Tools, iOS / OS X Swift Tool Belt, Part 5: Adding a Gradient UIButton A class derived from UIButton that will draw your button with a gradient background in Swift, using Xcode’s Interface Builder.