title: How do I add a tap gesture to an image with swift
body: <p>I know this is quite basic, I'm starting out with swift and I couldn't find a working example. </p>
  
  <p>I'd like to tap an image and do an action. The IBOutlet is linked to an image on the Main Storyboard. When I tap it, I get nothing. I was expecting to get a console message. What am I doing wrong?</p>
  
  <pre><code>import UIKit
  
  class FirstViewController: UIViewController {
  
      @IBOutlet weak var tapView: UIImageView!
      let tapRec = UITapGestureRecognizer()
  
      override func viewDidLoad() {
          super.viewDidLoad()
          // Do any additional setup after loading the view, typically from a nib.
  
          tapRec.addTarget(self, action: "tappedView")
          tapView.addGestureRecognizer(tapRec)
  
      }
  
      func tappedView(){
          println("image tapped")
      }
  
      override func didReceiveMemoryWarning() {
          super.didReceiveMemoryWarning()
          // Dispose of any resources that can be recreated.
      }
  
  
  }
  </code></pre>