Mon code ci-dessous est un bouton qui, lorsqu'il est frappé, applique une animation. En ce moment il y a deux animations. Je voudrais faire une séquence qui signifie que la deuxième animation ne démarre pas avant la fin de la première animation.Comment faire une animation de séquence sur une vue de texte (swift3)
var speed: CGFloat = 5.3 // speed in seconds
@IBAction func press(_ sender: Any) {
self.theTextView.resignFirstResponder()
UIView.animate(withDuration: TimeInterval(speed), animations: {
////1st action[
self.theTextView.contentOffset = .zero
self.theTextView.setContentOffset(.zero, animated: true)]
/////2nd action[
self.theTextView.contentOffset = CGPoint(x: 0, y: self.theTextView.contentSize.height)]
}, completion: nil)
}}