Mask UIView Touch Detect [closed]

2019-02-25 21:07发布

问题:

I have a big Frame through which i masked a smaller view now i want to detect just smaller one but touches began did not allow me to filter masked view any pointers ?

回答1:

- (void)viewDidLoad
{

 UITapGestureRecognizer *gr = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(UIviewTapped:)];
 [yourUIview addGestureRecognizer:gr];

}

-(void) UIviewTapped:(UIView *)view
{

  // write touched code here. 

}