Post

Replies

Boosts

Views

Activity

Reply to NavigationView is messing up with .prefersDefaultFocus(in:) in tvOS
Not sure if this gives you what you are looking for. I've found that you run into problems when a NavigationView is too global. import SwiftUI struct TestSelectionView: View { @FocusState var focused: Bool? var body: some View { VStack { Image(systemName: "globe") .imageScale(.large) .foregroundColor(.accentColor) Text("Hello, world!") HStack { NavigationView { VStack { NavigationLink(destination: Text("gone to left 1").focusable(), label: { Text("Left 1").focusable() }) } } NavigationView { VStack { NavigationLink(destination: Text("gone to right 1").focusable(), label: { Text("right 1").focusable() }) NavigationLink(destination: Text("gone to right 2").focusable(), label: { Text("right 2").focusable() }) .focused($focused, equals: true) .onAppear { self.focused = true } NavigationLink(destination: Text("gone to right 3").focusable(), label: { Text("right 3").focusable() }) } } } .padding(.top, 50) } .padding() } } #Preview { TestSelectionView() } code-block
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’23
Reply to NavigationLink is clipped on the left side
Further clarification: Any construct of the following (tvOS, iOS 17) var body: some View { VStack { Form { NavigationLink("Show Nothing 01", destination: Text("Nothing").focusable()) } List { NavigationLink("Show Nothing 02", destination: Text("Nothing").focusable()) } } } Where the NavigationLink is occupying less than the entire screen, causes the navigation button to get clipped off. Depending on the other container the above is in.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’23
Reply to tvOS/SwiftUI: toolbar item steals focus
Without a "focusable" item, on tvOS, Navigation does not work as it does on iOS. Your Text controls need to be of the form Text("something").focusable(). It's not obvious that tvOS behaves differently in this regard.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’23
Reply to SwiftUI and tvOS remote
I wasn't able to get a clear answer on this point when spanning multiple versions of tvOS. GameController appears to be the only certain approach at the moment. Hopefully someone that knows better will chime in.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Sep ’23
Reply to Unable to FaceTime in Apple TV A1842
FaceTime does not appear to be supported on this model. I have the same issue. Just moving one generation ahead appears to be sufficient. Drag. Would be helpful if Apple was clearer on what models will be supported. I have three gens, only the last two are supported.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Sep ’23
Reply to NavigationView is messing up with .prefersDefaultFocus(in:) in tvOS
Not sure if this gives you what you are looking for. I've found that you run into problems when a NavigationView is too global. import SwiftUI struct TestSelectionView: View { @FocusState var focused: Bool? var body: some View { VStack { Image(systemName: "globe") .imageScale(.large) .foregroundColor(.accentColor) Text("Hello, world!") HStack { NavigationView { VStack { NavigationLink(destination: Text("gone to left 1").focusable(), label: { Text("Left 1").focusable() }) } } NavigationView { VStack { NavigationLink(destination: Text("gone to right 1").focusable(), label: { Text("right 1").focusable() }) NavigationLink(destination: Text("gone to right 2").focusable(), label: { Text("right 2").focusable() }) .focused($focused, equals: true) .onAppear { self.focused = true } NavigationLink(destination: Text("gone to right 3").focusable(), label: { Text("right 3").focusable() }) } } } .padding(.top, 50) } .padding() } } #Preview { TestSelectionView() } code-block
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’23
Reply to NavigationLink is clipped on the left side
Further clarification: Any construct of the following (tvOS, iOS 17) var body: some View { VStack { Form { NavigationLink("Show Nothing 01", destination: Text("Nothing").focusable()) } List { NavigationLink("Show Nothing 02", destination: Text("Nothing").focusable()) } } } Where the NavigationLink is occupying less than the entire screen, causes the navigation button to get clipped off. Depending on the other container the above is in.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’23