Swift 3
// Default state (previously `.Normal`)
button.setImage(UIImage(named: "image1"), for: [])
// Highlighted
button.setImage(UIImage(named: "image2"), for: .highlighted)
// Selected
button.setImage(UIImage(named: "image3"), for: .selected)
// Selected + Highlighted
button.setImage(UIImage(named: "image4"), for: [.selected, .highlighted])
Для установки фонового изображения мы можем использовать setBackgroundImage(_:for:)
Swift 2.x
// Normal
button.setImage(UIImage(named: "image1"), forState: .Normal)
// Highlighted
button.setImage(UIImage(named: "image2"), forState: .Highlighted)
// Selected
button.setImage(UIImage(named: "image3"), forState: .Selected)
// Selected + Highlighted
button.setImage(UIImage(named: "image4"), forState: [.Selected, .Highlighted])