When touches Cancelled method get invoked in iPhone?

前端 未结 5 763
南笙
南笙 2021-02-05 07:49

I am able to understand that when user just touches the view, touches Began and Ended called. When user swipes their hand on a view, touches Moved method gets called. But when d

5条回答
  •  旧巷少年郎
    2021-02-05 08:07

    Note: touches also get cancelled if you start a UIView animation after touchesBegan. To prevent this make sure you include UIViewAnimationOptionAllowUserInteraction:

    e.g.

    [UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionAllowUserInteraction animations:^{
                self.aView.hidden = NO;
                self.aView.alpha = 1;
            } completion:nil];
    

提交回复
热议问题