Ive got this line of code that changes the image on a button when clicked:
sender.setImage(UIImage(named: "something.png")!, forState: .Highlighted)
When you call
setImage(_:for:), that is setting the buttons image for the passed in state. You don't have to call it every time the button is tapped. Try call
viewDidLoad, instead of in your IBAction.
The problem is the button has the default highlight state until its first tapped, which is why you are seeing what you are seeing.