当 UITextField 单独存在时,以下代码可以晃动
let animation = CAKeyframeAnimation()
animation.keyPath = "position.x"
animation.values = [0, 10, -10, 10, 0]
animation.keyTimes = [0, 1/6.0, 3/6.0, 5/6.0, 1]
animation.duration = 0.4
animation.additive = true
textField.layer.addAnimation(animation, forKey: "shake")
然而当 UITextField 内嵌在一个 UIAlertController 中时就不起作用了,请问如何解决