Can you attach a UIGestureRecognizer to multiple views?

前端 未结 12 1030
忘了有多久
忘了有多久 2020-11-22 14:08
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapTapTap:)];
[self.view1 addGestureRecognizer:tapGesture];         


        
12条回答
  •  情书的邮戳
    2020-11-22 15:04

    Override class by ''

    And use this method in .m class:

    - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer{
        return YES;
    }
    

    This method will help you to enable multiple swipe on a single view..

提交回复
热议问题