Created
October 4, 2016 15:18
-
-
Save mbuff24/63c597f0000a6a15a7936cfc5f48aaff to your computer and use it in GitHub Desktop.
Overriding inherited animation speed in tvOS
This file contains hidden or 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
override func didUpdateFocus(in context: UIFocusUpdateContext, with coordinator: UIFocusAnimationCoordinator) { | |
super.didUpdateFocus(in: context, with: coordinator) | |
let duration = UIView.inheritedAnimationDuration * 2 | |
UIView.animate(withDuration: duration, delay: 0, options: [.overrideInheritedDuration, .overrideInheritedCurve], animations: { [weak self] in | |
self?.layoutIfNeeded() | |
}, completion: nil) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment