Created
September 10, 2015 20:46
Revisions
-
bachand created this gist
Sep 10, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ class ActionHeroesView: UIView { let stalloneButton: UIButton let vanDammeButton: UIButton // ... override func didUpdateFocusInContext(context: UIFocusUpdateContext, withAnimationCoordinator coordinator: UIFocusAnimationCoordinator) { super.didUpdateFocusInContext(context, withAnimationCoordinator: coordinator) // we'll center Stallone when neither is in focus since he's a bigger deal let vanDammeFocused = (context.nextFocusedView == vanDammeButton) layoutIfNeeded() coordinator.addCoordinatedAnimations({ self.stalloneCenterXConstraint.active = !vanDammeFocused self.vanDammeCenterXConstraint.active = vanDammeFocused self.layoutIfNeeded() }, completion: nil ) } }