我想更改动画中的蒙版
但是就像在没有动画的情况下更改另一个蒙版一样 screen record
我希望它看起来像this
func creatMask(_ index: Int) -> CALayer {
let layer = CALayer()
let image = [#imageLiteral(resourceName: "bubble_1.png"),#imageLiteral(resourceName: "bubble_2.png"),#imageLiteral(resourceName: "bubble_3.png"),#imageLiteral(resourceName: "bubble_4.png"),#imageLiteral(resourceName: "bubble_5.png")]
layer.contents = image[index].cgImage
layer.contentsScale = image[index].scale
layer.frame = CGRect(x: 0, y: 0, width: 200, height: 200)
return layer
}
@objc func transform() {
UIView.animate(withDuration: 1) {
self.redView.layer.mask = self.creatMask(1)
}
}
}