I'd have a speech at a begin of a long pressure:
But the speech start only when the button is released.
Is there a way to let the speech start immediately even during a long pressure gesture recogniser?
Code Block class Cell: UITableViewCell { override func awakeFromNib() { ... let willSpeech = UILongPressGestureRecognizer(target: self, action: #selector(longPress(gesture:))) button.addGestureRecognizer(willSpeech) } @objc func longPress(gesture: UILongPressGestureRecognizer) { switch gesture.state { case .began: let utterance = AVSpeechUtterance(string: "hello") let speechSynthesizer = AVSpeechSynthesizer() speechSynthesizer.speak(utterance) ... } } }
But the speech start only when the button is released.
Is there a way to let the speech start immediately even during a long pressure gesture recogniser?