SmoothCheckBox icon indicating copy to clipboard operation
SmoothCheckBox copied to clipboard

快速点击会出现崩溃的问题

Open sunKit-io opened this issue 7 years ago • 0 comments

为了和Android统一 ,在项目中用到了,但是当我快速点击的时候,项目出现了崩溃 查找问题,确定问题发生在:

#pragma mark -- animation
// border 基础动画
- (void)startBorderLayerAnimation {
if (self.isChecked) {

这一行> for (CALayer *subLayer in self.borderCircle.sublayers) {

 [subLayer removeFromSuperlayer];
        }
}

经过几次修改,发现了一个更简单的实现方法 self.borderCircle.sublayers = nil; 直接将数组置空 就没问题了

sunKit-io avatar Jul 04 '18 10:07 sunKit-io