私はimageViewを持っています。imageViewをクリックすると表示されます。I used UIGestureRecognizer
パン、回転、長押し用。UILongPressGestureRecognizer
イメージビューの削除に使用しました。画像をクリックした後、imageView が表示されません。
コード:
-(void)img:(id)sender {
[self.view addSubView:myImageView];
UILongPressGestureRecognizer *sslongpress=[[UILongPressGestureRecognizer alloc]initWithTarget:self action:@selector(sslongPress:)];
[myImageView addGestureRecognizer:sslongpress];
}
-(void)sslongPress:(UILongPressGestureRecognizer*)sender {
[myImageView removeFromSuperview];
}