Skip to content

Instantly share code, notes, and snippets.

@maximbilan
Last active October 30, 2015 18:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maximbilan/8dbd2aa49f8ab2a068c7 to your computer and use it in GitHub Desktop.
Save maximbilan/8dbd2aa49f8ab2a068c7 to your computer and use it in GitHub Desktop.
tvOS Custom Button Highlighting
override func didUpdateFocusInContext(context: UIFocusUpdateContext, withAnimationCoordinator coordinator: UIFocusAnimationCoordinator) {
context.nextFocusedView!.layer.shadowOffset = CGSizeMake(0, 15)
context.nextFocusedView!.layer.shadowOpacity = 0.6
context.nextFocusedView!.layer.shadowRadius = 50
context.nextFocusedView!.layer.shadowColor = UIColor.redColor().CGColor
context.previouslyFocusedView?.layer.shadowOpacity = 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment