WeChatFloat icon indicating copy to clipboard operation
WeChatFloat copied to clipboard

定时器销毁时机问题

Open JustLee-me opened this issue 4 years ago • 0 comments

} else if (self.edgePan.state == UIGestureRecognizerStatePossible) { ///这个位置的代码不应该在动画结束后销毁定时器,否则会在动画过程中继续回调定时器,多次UIGestureRecognizerStatePossible状态 [self.floatArea removeFromSuperview]; self.floatArea = nil; [self.link invalidate]; self.link = nil; [UIView animateWithDuration:0.5 animations:^{ self.floatArea.frame = CGRectMake(SCREEN_WIDTH, SCREEN_HEIGHT, kFloatAreaR, kFloatAreaR); } completion:^(BOOL finished) { if (self.showFloatBall) { self.floatViewController = self.tempFloatViewController; if ([self haveIconImage]) { self.floatBall.iconImageView.image = [self.floatViewController valueForKey:@"hk_iconImage"]; } self.floatBall.alpha = 1; [kWindow addSubview:self.floatBall]; } }]; }

JustLee-me avatar Jul 16 '20 13:07 JustLee-me