How to call a method only once during -(void)touchesMoved?

后端 未结 4 785
心在旅途
心在旅途 2021-01-27 02:02

I am using - (void) touchesMoved to do stuff when ever I enter a specific frame, in this case the area of a button.

My problem is, I only w

4条回答
  •  一个人的身影
    2021-01-27 02:37

    if( CGRectContainsPoint([p1 frame],[touch locationInView:self.view])) {
       NSLog (@"Touch Moved over p1");
      if (!p14.isHighlighted) {
       [self action: p1];
       p1.highlighted = YES; 
       }
      }else {
       p1.highlighted = NO;
      }
    

提交回复
热议问题