constraint animations animate ios swift3 uiviewanimation

ios - animations - uiview animate swift 4



UIView.animado-Swift 3-finalizaciĆ³n (2)

Escríbelo como debajo del código:

UIView.animate(withDuration: 0.5, delay: 0, usingSpringWithDamping: 1, initialSpringVelocity: 1, options: .curveEaseOut, animations: { // code })

¿Cómo hago un bloque de finalización simple en Swift 3?

Quiero establecer self.isOpen = true en la finalización de la animación:

UIView.animate(withDuration: 0.25, delay: 0.0, options: [], animations: { self.isOpen = true self.drawerView?.frame = CGRect(x: 0, y: 0, width: (self.drawerView?.frame.size.width)!, height: (self.drawerView?.frame.size.height)!) self.contentView?.frame = CGRect(x: 200, y: 0, width: (self.contentView?.frame.size.width)!, height: (self.contentView?.frame.size.height)!) }, completion: nil)

De paso:

Es bastante imposible aprender Swift 3 atm debido a que NADA en el funcionamiento de Internet :(

También busqué en todo este documento incluso una mención de la palabra "animar" y no pude encontrar nada:

https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/index.html#//apple_ref/doc/uid/TP40014097-CH3-ID0


Lo agregas así:

UIView.animate(withDuration: 0.25, delay: 0.0, options: [], animations: { self.drawerView?.frame = CGRect(x: 0, y: 0, width: (self.drawerView?.frame.size.width)!, height: (self.drawerView?.frame.size.height)!) self.contentView?.frame = CGRect(x: 200, y: 0, width: (self.contentView?.frame.size.width)!, height: (self.contentView?.frame.size.height)!) }, completion: { (finished: Bool) in self.isOpen = true })