Skip to content

Instantly share code, notes, and snippets.

@mbuff24
Created October 4, 2016 15:18
Show Gist options
  • Save mbuff24/63c597f0000a6a15a7936cfc5f48aaff to your computer and use it in GitHub Desktop.
Save mbuff24/63c597f0000a6a15a7936cfc5f48aaff to your computer and use it in GitHub Desktop.
Overriding inherited animation speed in tvOS
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