To change your background color of the botton use:
yourBtn.backgroundColor = UIColor.black
if you are using storyBoard
make sure you have connected your storyBoard
with your viewController
and also that your items are linked.
if you donĀ“t know how to do this check the next link:
How to connect ViewController.swift to ViewController in Storyboard?