I have a text box in which the user must enter information. And a label that indicates the user a text field (for example, a tooltip).
I want to stop the animation and remove the tooltip shortly as soon as the user clicks a text field to enter data.
The animation on the text label repeats. Created:
override func viewDidLoad() { super.viewDidLoad() textInput.addTarget(self, action: #selector(CalculatorViewController.removeAnimation(_:)), forControlEvents: UIControlEvents.TouchDown) self.hintLabel.alpha = 0.0 UIView.animateWithDuration(1.5, delay: 0, options: .Repeat , animations: ({ self.hintLabel.alpha = 1.0 }), completion: nil )
After that I created a function to remove annotation
func removeAnimation(textField: UITextField) { view.layer.removeAllAnimations() self.view.layer.removeAllAnimations() print("is it working?!") }
Should work in accordance with the documentation.

My shortcut continues to flash, although I see a line printed on the console. I think the problem is that the animation repeats, but has no idea how to solve this problem.
source share