You can follow the discussion on Swift Tool Belt, Part 8: Extending UIButton with Background Color for State without having to leave a comment. Cool, huh? Just enter your email address in the form here below and you're all set.