實(shí)現(xiàn)是currentLabel文字方法縮小實(shí)現(xiàn)閃動(dòng)效果。
代碼如下:
let anim = CABasicAnimation(keyPath: "transform.scale")
anim.toValue = 0.5
anim.duration = 1
anim.repeatCount = MAXFLOAT
anim.isRemovedOnCompletion = true
currentLabel.layer.add(anim, forKey: nil)
移除動(dòng)畫:
currentLabel.layer.removeAllAnimations()