How can I disable the default tvOS focus animations in UITextField?

How can I disable the default tvOS focus animations in UITextField?

I tried layer.removeAllAnimations() but this does not work

     @IBOutlet weak var login: UITextField! 
@IBOutlet weak var password: UITextField!
override func viewDidLoad() {
super.viewDidLoad()
login.layer.removeAllAnimations() }

Replies

You can subclass and not call super.didUpdateFocus will disable all the focus animations on the text field. I reccoemned adding your own logic

Code Block
public final class FocusDisabledTextField: UITextField {
    override public func didUpdateFocus(
        in context: UIFocusUpdateContext,
        with coordinator: UIFocusAnimationCoordinator
/// You should add your own focus behaviour e.g.
backgroundColor = context.nextFocusedView == self ? UIColor.blue : UIColor.green
    ) {}
}