https://github.com/bryanjclark/devsign-customfocuseffect
A way to make non-roundrect, focusable views on tvOS.
https://github.com/bryanjclark/devsign-customfocuseffect
Last synced: about 1 month ago
JSON representation
A way to make non-roundrect, focusable views on tvOS.
- Host: GitHub
- URL: https://github.com/bryanjclark/devsign-customfocuseffect
- Owner: bryanjclark
- License: mit
- Created: 2016-03-01T19:21:13.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-03-01T22:17:05.000Z (about 9 years ago)
- Last Synced: 2025-03-28T02:11:11.818Z (about 2 months ago)
- Language: Swift
- Size: 17.6 KB
- Stars: 18
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Creating Custom Focus Effects in tvOS
In my current side-project, I’m making a tvOS app. One of the screens features a handful of circular buttons. Unfortunately, when the tvOS Focus Engine renders these buttons, they get _really awful_ shadows and focus states, that look a bit [like this](http://clrk.it/1fn4Q).
I had the good fortune of attending Apple’s tvOS Tech Talk in Seattle this winter - which meant I got to ask a few folks in the Q&A lab! They told me that, unfortunately, tvOS doesn’t allow non-roundrect focus effects: the system-standard focused state are pretty “simple” and aren’t clever enough (yet) to alter their shape depending on the alpha-channel of the image in the `UIButton`.
We needed to roll our own custom focus effect - but fortunately, it turned out to be pretty straightforward!
Here’s what the finished product looks like:

There's a whole write-up about this project over on [devsign.co](https://devsign.co/notes/custom-focus-effects-in-tvos)
Enjoy!