I would like a different background color when the user selects a tab bar item than when it is unselected.
Answer in swift 4:
setSelectedImageTintColor is deprecated on iOS 8.
Instead use this :
self.tabBar.tintColor = UIColor.white