Update the passcode lock view
This commit is contained in:
parent
35f599c45b
commit
c4f0462d43
6 changed files with 63 additions and 16 deletions
|
|
@ -20,4 +20,14 @@ extension UITextField {
|
|||
objc_setAssociatedObject(self, &kAssociationKeyNextField, newField, .OBJC_ASSOCIATION_RETAIN)
|
||||
}
|
||||
}
|
||||
|
||||
func shake() {
|
||||
let animation = CAKeyframeAnimation(keyPath: "transform.translation.x")
|
||||
animation.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.linear)
|
||||
animation.repeatCount = 3
|
||||
animation.duration = 0.2/TimeInterval(animation.repeatCount)
|
||||
animation.autoreverses = true
|
||||
animation.values = [3, -3]
|
||||
layer.add(animation, forKey: "shake")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue