Buttons and NavigationLinks in TVOS using Swiftui

Is it just me or there's little to none customization options for Button and NavigationLink using SwiftUI for tvOS?

No matter what you try you'll always end up screwing up the graphics of the element or disabling the button (with disabling i mean you can no more interact with it with the remote, it does not executhe the action: nor it goes to the destination:).

If someone has found a way to interact and customize these elements on tvOS please let me know.

Plus i noticed that .focusable doesn't work at all while using both Button and NavigationLink

This might help :slight_smile:

Hello, i managed to implement the focus change myself with state, however when using buttons the .onMoveCommand { (direction) in does not work with the remote swipe (and the onFocusChange does not see the direction you're swiping, so it has to be discarded) . Using the keyboard seems fine but usually users don't use keyboards while using the tv.

Another thing i found (sorry if i add more information in the reply) is that you can't create empty focusable items, so (for example) if you have two buttons above and three below you can't access the second button swiping from the third button below.

Seems like i'm missing something

Please don't let this die, Tvos developers do exist and we need SwiftUI too.

Neither buttons nor navigation links seem to be customizable at all, .frame() does not do anything, .focusable() does not do anything and they behave very weirdly when the parent view has .edgesIgnoringSafeArea(.all)


Fix needed ASAP

Keep in mind that this is a forum about the Swift language, so this is a little off-topic. From what I see, while we generally welcome these kind of questions, it's not easy to find someone who can actually answer here (perhaps that's partly why it's off-topic).

Maybe you could also try file bug report (feedbackassistant.apple.com), or post also on developer forum (forums.developer.apple.com) and even on stack overflow.

SwiftUI documentation is indeed quite lacking, to say the least. That's something one can give feedback (via the link above) as well.

Terms of Service

Privacy Policy

Cookie Policy