title: Changing image of UIButton via click - XCode 6 Swift
body: <p>Im simply trying to make it so when I click on a UIButton (for which it currently shows the image of a shell), the image changes into something else (in this case, a coin).
  This is what i tried so far and have not had any success. I cant find anything to do this for Swift.Thanks.</p>
  
  <pre><code>import UIKit
  
  class ViewController: UIViewController {
  
  @IBOutlet weak var lblOutput: UILabel!
  @IBOutlet weak var lblWin: UILabel!
  @IBOutlet weak var lblLost: UILabel!
  @IBOutlet weak var lblWinsAmt: UILabel!
  @IBOutlet weak var lblLossesAmt: UILabel!
  
  
  
  let coin = UIImage(named: "penny_head") as UIImage;
  
  
  override func viewDidLoad() {
      super.viewDidLoad()
      //imgShell1.hidden = true //doesnt work
  }
  
  override func didReceiveMemoryWarning() {
      super.didReceiveMemoryWarning()
      // Dispose of any resources that can be recreated.
  }
  
  
  @IBAction func btnStart(sender: UIButton) {
  
  }
  
  @IBAction func btnShell1(sender: UIButton) {
  
      sender.setImage(coin,forState: UIControlState.Highlighted);
  }
  </code></pre>