title: How to change button image in swift?
body: <p>I am working on an app which has a button. The button has no text, image or background. </p>
  
  <p>So what I want to do is to give it an image in the viewDidLoad function.</p>
  
  <p>This is what I have: </p>
  
  <pre><code>@IBOutlet var tapButton: UIButton!
  
  override func viewDidLoad() {
  
      super.viewDidLoad()
  
      tapButton.setImage("redTap.png", forState: UIControlState.Normal)
  }
  </code></pre>
  
  <p>But I have an error that says I can not convert string to UIIMage.</p>
  
  <p>How do I get it to work? </p>
  
  <p>I have tried:</p>
  
  <pre><code>let image = UIImage(named: "redTap.png")
  
  tapButton.setImage(image, forState: UIControlState.Normal)
  </code></pre>
  
  <p>I have gotten it to work but now I have a problem. </p>
  
  <p>The image is suppose to be a red text but it shows up blue. </p>
  
  <p>I was able to get the image to show correctly by using:</p>
  
  <pre><code>let image = UIImage(named: imageColor[randNum])?.imageWithRenderingMode(.AlwaysOriginal)
  tapButton.setImage(image, forState: UIControlState.Normal)
  </code></pre>
  
  <p>What I want now is to not have the button be highlighted when the button is pressed. I have a few other buttons that have images assigned to them in xcode and not through code. They don't highlight when pressed.</p>
  
  <p>So how can I get rid of highlighting when the button is pressed?  </p>