I have animations on my 2 labels and I can't seem to click on them, I am not sure where the problem lies.
Code Block override func viewDidLoad() { super.viewDidLoad() let tapGestureR = UITapGestureRecognizer(target: self, action: #selector(self.tapRev)) revLabel.addGestureRecognizer(tapGestureR) revLabel.isUserInteractionEnabled = true let tapGestureP = UITapGestureRecognizer(target: self, action: #selector(self.tapPro)) proLabel.addGestureRecognizer(tapGestureP) proLabel.isUserInteractionEnabled = true buttonNext.layer.cornerRadius = 10 animatePro() animateRev() }
Code Block func animatePro() { UIView.animate(withDuration: 2, delay: 0, options: [.autoreverse], animations: { UIView.setAnimationRepeatCount(100) self.proLabel.transform = CGAffineTransform(scaleX: 1.5, y: 1.5) }){ (finished) in self.proLabel .transform = CGAffineTransform.identity } } func animateRev() { UIView.animate(withDuration: 2, delay: 0, options: .repeat, animations: { self.revLabel.transform = CGAffineTransform(scaleX: 1.5, y: 1.5) }){ (finished) in UIView.animate(withDuration: 2, delay: 0, options: .repeat, animations: { self.revLabel.transform = CGAffineTransform.identity }) } } @objc func tapRev() { print("gesture rev fired") self.labelGC.text = "Ultimately, customers are our sources of \nrevenue , and financial stability." revLabel.alpha = 0 proLabel.alpha = 0 } @objc func tapPro() { print("gesture pro fired") self.labelGC.text = "Ultimately, customers are our sources of \nprofit , and financial stability." proLabel.alpha = 0 revLabel.alpha = 0 }