Created
February 13, 2018 18:00
-
-
Save zenangst/73dcdd19f46b4dc5b3d2b4ccb00d162b to your computer and use it in GitHub Desktop.
Syncing UIView animations - Framework implementation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let animationDuration: TimeInterval? = subviewsInLayoutOrder | |
.flatMap({ $0.layer.resolveAnimationDuration }).first ?? duration | |
if let duration = animationDuration { | |
let options: UIViewAnimationOptions = [.allowUserInteraction, .beginFromCurrentState] | |
UIView.animate(withDuration: duration, delay: 0.0, options: options, animations: { | |
self.runLayoutSubviewsAlgorithm() | |
}) | |
} else { | |
runLayoutSubviewsAlgorithm() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment