Set the background color of any UIButton
.
-
Download
From the root directory of your project's Git repository, run:
git submodule add [email protected]:acani/UIButtonBackgroundColor.git Libraries/UIButtonBackgroundColor
-
Install
From Finder, drag the newly created directory to your project's project navigator in Xcode.
Uncheck "Copy items if needed," select "Create groups," and uncheck all targets.
In Xcode, remove the reference to
UIButtonBackgroundColor/.gitignore
.Add
UIButtonBackgroundColor.swift
to your target. -
Use
myButton.setBackgroundColor(UIColor.blueColor(), forState: .Normal)
Released under the Unlicense.