title: Detect tap on UIImageView IOS
body: <p>Am I doing something wrong? I can't detect the tap on the <code>UIImageview</code>. The <code>UIImageView *myImage</code> is create in storyboard. the code files are here : <a href="https://drive.google.com/folderview?id=0B2jWw-2wZC52NDBFZ2lXUTUzQXM&amp;usp=sharing" rel="noreferrer">https://drive.google.com/folderview?id=0B2jWw-2wZC52NDBFZ2lXUTUzQXM&amp;usp=sharing</a></p>
  
  <p>File: <code>ViewController.h</code></p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  @interface ViewController : UIViewController
  
  @property (strong, nonatomic) IBOutlet UIImageView *myImage;
  
  @end
  </code></pre>
  
  <p>File: <code>ViewController.m</code></p>
  
  <pre><code>#import "ViewController.h"
  @interface ViewController ()
  
  @end
  
  @implementation ViewController
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
      // Do any additional setup after loading the view, typically from a nib.
  
      UIGestureRecognizer *tapGestureRecognizer = [[UIGestureRecognizer alloc] initWithTarget:self action:@selector(tappedImage:)];
      [self.myImage addGestureRecognizer:tapGestureRecognizer];
      self.myImage.userInteractionEnabled = YES; // default is no for UIImageView
  
  }
  
  - (void)tappedImage:(UIGestureRecognizer *)gestureRecognizer {
      //UIImageView *myImage = (UIImageView *)gestureRecognizer.view;
      // do stuff;
      NSLog(@"it works");
  }
  
  
  @end
  </code></pre>