Created
November 3, 2014 14:04
-
-
Save yuxiangq/b56b55a42585a8a18d0f to your computer and use it in GitHub Desktop.
给UIImageView添加UITapGestureRecognizer示例
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(void)initUIImageView{ | |
UIImageView imageView = [[UIImageView alloc] init]; | |
imageView.userInteractionEnabled = YES; | |
UITapGestureRecognizer *tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapImageView:)] | |
[imageView addGestureRecognizer:tapGestureRecognizer]; | |
} | |
-(void)tapImageView:(UITapGestureRecognizer*)sender{ | |
//doSomething | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment