[UITapGestureRecognizer tag]: unrecognized selector sent to instance

前端 未结 5 1457
一个人的身影
一个人的身影 2020-12-16 00:44

I am having a series of imageview arranged, and assigning a TapView recognizer to it

UITapGestureRecognizer *tapRecognizer = [[UITa         


        
5条回答
  •  清酒与你
    2020-12-16 01:04

    Just Change your Selector Method with the following..and it will work

    tapgesture will have the whole view which is tapped.. and then you can get the tag property from it as i have stated in following

    -(void)action:(UITapGestureRecognizer *)tapGesture{
    
         NSLog(@"TESTING TAP");
            NSLog (@"%d",tapGesture.view.tag);
    
        }
    

提交回复
热议问题