为UIView添加波纹效果

时间:2018-11-21 11:59:37

标签: ios swift uiview ripple

我正在尝试使用以下代码向UIView添加波纹效果。

let animation = CATransition() 
animation.delegate = self 
animation.duration = 2 
animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) 
animation.type = "rippleEffect" 
myView.layer.addAnimation(animation, forKey: nil)

0 个答案:

没有答案