enable user interaction by changing alpha swift iOS
问题 I have a view with the tap function (user interaction is enabled). If I set it without changing alpha it works well. But if I try to change alpha of this view with delay, it cannot be tapped during this animation. Could somebody help? Here is my code: import UIKit class ViewController: UIViewController { var myView = UIView() var n = 0 override func viewDidLoad() { super.viewDidLoad() setView() changeAlpha() } func changeAlpha() { UIView.animate(withDuration: 5) { self.myView.alpha = 0.1 } }