tvOS is the operating system for Apple TV.

Posts under tvOS tag

96 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

UIButton starts out focused but can't navigate back to it
I'm an experienced iOS developer but new to tvOS, and I'm finding the focus engine to be somewhat confounding. My app launches with a UINavigationController, whose root view is a UITableViewController. When I select a row, a UIViewController is pushed. That view controller contains a bunch of nested UICollectionViews. One of the collection view cells contains 3 UIButtons. When the view first appears, the first of those (Button1) has focus. I can move focus from Button1 to Button2, and from Button2 to Button3. I can also go back from Button3 to Button2. But I cannot navigate back to Button1, and I'm trying to figure out why. I have focus logging turned on. It's very verbose, but here are the parts that seem useful to me: When the view controller displays initially, I see Updating focus from <UITableViewCell: 0x104841a00> to <DXETV.CustomButton: 0x104232610> in focus system <UIFocusSystem: 0x60000370c900>. The result of the focus update was determined from the following preferred focus search: | | Starting preferred focus search. | <UINavigationController: 0x10600f000> | └ <DXETV.RenderExampleViewController: 0x10484ae00> | └ <DXETV.RenderExampleView: 0x10421ab70> | └ <DXETV.LayoutElementView: 0x107021000> | └ <DXETV.LayoutCollectionView: 0x10707d200> | └ <DXETV.LayoutViewCell: 0x10681ee00> | └ <DXETV.LayoutElementView: 0x106862000> | └ <DXETV.LayoutCollectionView: 0x106865a00> | └ <DXETV.LayoutViewCell: 0x106851000> | └ <DXETV.LayoutElementView: 0x104891800> | └ <DXETV.LayoutCollectionView: 0x10488da00> | └ <DXETV.LayoutViewCell: 0x1048de600> | └ <DXETV.CustomButton: 0x104232610> | (info) It's focusable! | This seems right... focus moves from the table view cell to Button1, and this is he view hierarchy I expect. Then we see Creating focus scroll animator entry for environment <DXETV.LayoutCollectionView: 0x10707d200> This is the topmost collection view. This is followed by many lines about locking and unlocking this collection view, followed by Removing focus scroll animator entry for environment <DXETV.LayoutCollectionView: 0x10707d200> I don't know if this is normal or not. After I move focus from Button1 to Button2, I see Updating focus with context <UIFocusUpdateContext: 0x6000033200a0: previouslyFocusedItem=<DXETV.CustomButton 0x104232610>, nextFocusedItem=<DXETV.CustomButton 0x104312900>, focusHeading=Down>: Moving focus from <DXETV.CustomButton: 0x104232610> to <DXETV.CustomButton: 0x104312900> in focus system <UIFocusSystem: 0x60000370c900>. Which seems correct. When I move focus from Button2 to Button3, I get this, which is now expected: Updating focus with context <UIFocusUpdateContext: 0x60000330c5a0: previouslyFocusedItem=<DXETV.CustomButton 0x104312900>, nextFocusedItem=<DXETV.CustomButton 0x1043134d0>, focusHeading=Down>: Moving focus from <DXETV.CustomButton: 0x104312900> to <DXETV.CustomButton: 0x1043134d0> in focus system <UIFocusSystem: 0x60000370c900>. Followed by another round of creating and removing a focus scroll animator entry, this time for the middle collection view. Moving from Button3 back to Button2 also looks as expected: Updating focus with context <UIFocusUpdateContext: 0x600003318f00: previouslyFocusedItem=<DXETV.CustomButton 0x1043134d0>, nextFocusedItem=<DXETV.CustomButton 0x104312900>, focusHeading=Up>: Moving focus from <DXETV.CustomButton: 0x1043134d0> to <DXETV.CustomButton: 0x104312900> in focus system <UIFocusSystem: 0x60000370c900>. But here, everything stops. When I press the up arrow again to go back to Button1, nothing happens. Nothing is printed to the console, and the focused button does not change. Any hints as to what may be wrong or how to debug this further would be most appreciated!!!
0
0
327
Sep ’24
How to remove a second search text on tvOS18?
I have an issue on tvOS 18 beta from Aug 20, where the search text is displayed twice, as in the image below. Code to reproduce the behavior is trivial: struct ContentView: View { @State private var searchText = "" var body: some View { NavigationView { Text("Some content...") } .searchable(text: $searchText) } } I did not find anything new in the API or documentation to disable it. Also, online searches for this specific issue did not produce any results. I would like to show the same behavior on tvOS18, as on tvOS17, without the second search text. Any idea on how to hide that second search text?
1
0
397
Sep ’24
MacOS Sequoia tab bar issues (a bug also happens in tvOS 18)
I found two tab bar issues: How do you programmatically hide/show the tab bar for iPadOS and Catalyst apps under macOS Sequoia? Also, is there a way to prevent the user from doing this via the menu? Programmatically changing the current tab view correctly changes the tab view but not the tab item highlighted in the tab bar in: Mac Catalyst apps under Sequoia iPad apps under Sequoia tvOS 18 apps Is there a workaround I can use until this bug is fixed?
2
0
598
Aug ’24
Tab bar for tvOS 18 is positioned too low (bug?)
I've noticed the tab bar in tvOS 18 (beta) is positioned lower on the TV screen than in previous versions. Bug? I see no documentation on this important UI change... If this is not a bug, is there any way to adjust the y coordinate of the tab bar location in tvOS 18? I would really like to restore this to the previous location for my app and avoid having to do OS-conditional constraints for all my views/pages.
2
0
385
Aug ’24
tvOS 18.0 Siri back button behavior bug
On testing my app with tvOS 18, I have noticed the Siri Remote back button no longer provides system-provided behavior when interacting with tab bar controller pages. Instead of moving focus back to the tab bar when pressed, the back button will close the app, as if the Home button was pressed. This occurs both on device and in the Simulator. Create tvOS project with a tab bar controller. Create pages/tabs which contain focusable items (ie. buttons) Scroll down to any focusable item (ie. a button or UICollectionView cell) Hit the Siri Remote back button. See expect behavior below: Expected behavior: System-provided behavior should move focus back to the tab bar at the top of the screen. Actual results: App is closed and user is taken back to the Home Screen. Has anyone else noticed this behavior?
4
1
611
Oct ’24
OSStatus error:[-34018]
Every topic I can find online about this entitlement error suggests I don't have the correct entitlements on. I do in fact have the correct entitlements enabled, but xcode doesn't seem to recognize them. dev@dev-MacBook-Pro Debug-appletvos % codesign -d --entitlements - ProductName.app Executable=/Users/dev/Library/Developer/Xcode/DerivedData/ProductName-cmaicvialhhqtnbvmwehlympuxua/Build/Products/Debug-appletvos/ProductName.app/ProductName [Dict] [Key] application-identifier [Value] [String] <teamID>.Company.ProductName [Key] com.apple.developer.associated-domains [Value] [Array] [String] webcredentials:<api_url> [Key] com.apple.developer.team-identifier [Value] [String] <teamID> [Key] com.apple.developer.user-management [Value] [Array] [String] get-current-user [Key] com.apple.developer.weatherkit [Value] [Bool] true [Key] com.apple.security.application-groups [Value] [Array] [String] group.Company.ProductName [Key] get-task-allow [Value] [Bool] true [Key] keychain-access-groups [Value] [Array] [String] <teamID>.com.Company.ProductName [String] <teamID>.Company.ProductName OSStatus error:[-34018] Internal error when a required entitlement isn't present, client has neither application-identifier nor keychain-access-groups entitlements. I am unsure about the application-identifier part, as this isn't even an option in the entitlements, and keychain sharing was already turned on. These errors stop my app from launching. A few days ago this wasn't an issue. Now after launching xcode again this suddenly becomes an issue out of nowhere. Platform: tvOS simulator runtime and Apple TV 4k (3rd generation) Target version: 18.0 Development Hardware: macbook pro m2 max Development Software: macos Sonoma 14.5
2
0
481
Aug ’24
TabView navigation stuck in tvOS
I’m implementing a carousel view for tvOS. In its simplest version, it would be: struct HorizontalCarouselComponent: View { let contents: [ContentViewModel] var body: some View { TabView { ForEach(contents) { content in Text(content.title) .focusable(true) } } .tabViewStyle(.page) } } With this version, I can see the content correctly and also the pagination. However, when I navigate using the arrow keys on the Apple TV simulator, I notice that some elements of the carousel become unreachable. For example, I can move two positions to the right, and even though there are two more positions, I cannot continue moving forward. Do you have any ideas on what might be happening?
3
0
339
Aug ’24
TVOS focus stops working in search keyboard
Hi everyone, I'm trying to solve an issue with focus not being updated in UISearchController keyboard after some letters are typed (one or more if I'm lucky enough to swipe quickly). This started happening when I switched to Xcode 15 and the latest tvOS SDK. The focus engine logs do not explain much to me The result of the focus update was determined from the following preferred focus search: | | Starting preferred focus search. | <UIViewController: 0x10711d180> | └ <RCTRootView: 0x10711a810> | │ No more preferred environments. Trying to infer environment from visual layout... | │ Found environment: <UIKeyboard: 0x105ffcc40> | └ <UIKeyboard: 0x105ffcc40> | (info) It's focusable! | Moving focus from <UIKeyboard: 0x105ffcc40> to <UIKeyboard: 0x105ffcc40> in focus system <UIFocusSystem: 0x303568600>. Ignoring focus update request for disappearing focus environment <UIKBFloatingKeyView: 0x105eeb130>. <<TYPE LETTER GOES HERE >> - ISSUE: This environment does not contain the currently focused item. Ignoring focus update request for disappearing focus environment <_UITextLayoutFragmentView: 0x105fff620>. - ISSUE: This environment does not contain the currently focused item. Ignoring focus update request for disappearing focus environment <UISearchBarTextFieldLabel: 0x105ff6f70>. - ISSUE: This environment does not contain the currently focused item. Ignoring focus update request for disappearing focus environment <UILabel: 0x105ff5090>. - ISSUE: This environment does not contain the currently focused item. In the "focus-freeze" state is not possible to swipe anymore, but I still can repeat typing of the last letter. I'd appreciate any hints on how to debug this problem. Is it possible to list gesture recognizers or other objects that are consuming TV remote events ? I've confirmed the the [UIWindow sendEvent:] is still being triggered.
1
0
339
Aug ’24
Bug with Searchable in tvOS When iPhone Remote Used
Hi! I'm currently facing an issue on tvOS where any input I make with the iPhone remote keyboard, after the first character, would automatically be deleted after appearing on screen. It feels like there are 2 keyboards fighting to set the actual value; If you type fast enough, you could add extra characters to the back. Steps to reproduce: Use searchable within a tabview, navigationstack or navigation view on a tvOS app Open the Apple TV remote on your iPhone and start typing on the keyboard
0
1
330
Aug ’24
Problems when Preparing Apple TV via Apple Configurator 2
Model: Apple TV 4K (3rd generation) Wi-Fi & Ethernet 128GB I am an Apple Systems Admin for a school district. A contractor working on new buildings/upgrades for us purchased Apple TVs outside of our Apple account. When attempting to add these Apple TVs to Apple School Manager and enroll them into our MDM (via Apple Configurator 2 version 2.17), i'm running into a few problems. When inputting the Pair Code: -Says “Pairing Failed (-402653161)”--this error code only takes me to Apple Forums that end up answerless -But device still shows up under Paired Devices and in Configurator On Step 3 of 4 when “Preparing Apple TV—Activating TVOS” -An unexpected error has occurred with “Apple TV”. The device is not connected. [ConfigurationUtilityKit.error – 0x25B (603)]--this error code also only points me to Apple Forums for Configurator problems regarding iPads -only option is “Stop” -Appears that Configurator is still working in the background Click Stop (as it is my only option), then Apple TV then disappears from Configurator. Devices appear to be wiping OS/reinstalling OS and then going back to factory default settings. They are not being added to our ASM account. Any ideas?
6
4
1.2k
Aug ’24
UICollectionView can't keep the focused row stick to the top
I'm creating a Netflix like app on tvOS, here is my compositional layout that I use with my collectionView. private func createLayout() -> UICollectionViewCompositionalLayout { return UICollectionViewCompositionalLayout { (section, _) -> NSCollectionLayoutSection? in // item let itemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1), heightDimension: .fractionalHeight(1.0)) let item = NSCollectionLayoutItem(layoutSize: itemSize) item.contentInsets = NSDirectionalEdgeInsets(top: 0, leading: 10, bottom: 0, trailing: 10) // group let groupSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1/5), heightDimension: .estimated(350)) let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize, subitems: [item]) // section let section = NSCollectionLayoutSection(group: group) section.orthogonalScrollingBehavior = .groupPaging let headerSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0), heightDimension: .estimated(UIFont(name: "MyFont", size: 36)!.lineHeight)) let sectionHeader = NSCollectionLayoutBoundarySupplementaryItem( layoutSize: headerSize, elementKind: "SectionHeader", alignment: .top) section.boundarySupplementaryItems = [sectionHeader] section.contentInsets = NSDirectionalEdgeInsets(top: 0, leading: 20, bottom: 30, trailing: 0) return section } } So: My collection view is composed by several row (that are the sections). Each section is composed by groups containing 1 item each. Each section can be scrolled horizontally. And you can scroll vertically to move from a section to an other. I'm expecting to have the following behavior when scrolling: Horizontal scrolling: Before focus shifts -------------------------- | vA vB vC vD vE | | [v1] v2 v3 v4 v5 | | vU vW vX vY vZ | -------------------------- After focus shifts -------------------------- | vA vB vC vD vE | | [v2] v3 v4 v5 v6 | | vU vW vX vY vZ | -------------------------- Vertical scroll: Before focus shifts -------------------------- | [vA] vB vC vD vE | | v1 v2 v3 v4 v5 | | vU vW vX vY vZ | -------------------------- After focus shifts -------------------------- | [v1] v2 v3 v4 v5 | | vU vW vX vY vZ | | vF vG vH vI vJ | -------------------------- Thanks to section.orthogonalScrollingBehavior = .groupPaging the horizontal scrolling is working as expected. (I've put 1 item per group to achieve this) But I'm going crazy with the vertical scroll, I'm not able to achieve it as expected, the focused section still centered verticaly on the screen ! What I'm getting: Before focus shifts -------------------------- | [vA] vB vC vD vE | | v1 v2 v3 v4 v5 | | vU vW vX vY vZ | -------------------------- After focus shifts -------------------------- | vA vB vC vD vE | | [v1] v2 v3 v4 v5 | | vU vW vX vY vZ | -------------------------- After an other focus shifts -------------------------- | v1 v2 v3 v4 v5 | | [vU] vW vX vY vZ | | vF vG vH vI vJ | -------------------------- I've tried to play with the didUpdateFocusIn function without success func collectionView(_ collectionView: UICollectionView, didUpdateFocusIn context: UICollectionViewFocusUpdateContext, with coordinator: UIFocusAnimationCoordinator) { if let nextFocusedItemIndexPath = context.nextFocusedIndexPath { let section = nextFocusedItemIndexPath.section let sectionIndexPath = IndexPath(item: 0, section: section) collectionView.scrollToItem(at: sectionIndexPath, at: .top, animated: true) } } The collectionview is behaving strangely when using the didUpdateFocusIn function and I feel it's not the good way to perform what I'm expecting... I've also try to play with the scrollViewWillEndDragging function without success func scrollViewWillEndDragging(_ scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset: } Everything that I tried looks like a hack and I can't believe Apple has not plan something for this use case, which is in my sense a common use case....
1
0
442
Aug ’24
Competitor App lying in app screenshots.
My app is a pretty popular app and theres only one competitor, after they notice their sales drop shortly after me releasing my app, they have put in their main screenshot '#1 paid apps' this is a complete lie and is untrue. Its caused a drop in sales for my app. How should I go about this? Is there anything I can do? Ive reported this to apple a week and a half ago but have not received any response. Thanks, MYW
0
0
368
Aug ’24
Can’t focus the sidebar on tvOS when TabView contains TabSection elements
In a TabView with the .sidebarAdaptable style, including TabSection elements prevents the default back swipe on the remote from revealing the sidebar. Removing all TabSection elements and using only Tab elements makes it work as expected: import SwiftUI struct ContentView: View { var body: some View { TabView { Tab("Tab", systemImage: "square.fill") { Button(action: {}) { Text("Button") } } Tab("Tab", systemImage: "square.fill") { Button(action: {}) { Text("Button") } } Tab("Tab", systemImage: "square.fill") { Button(action: {}) { Text("Button") } } Tab("Tab", systemImage: "square.fill") { Button(action: {}) { Text("Button") } } Tab("Tab", systemImage: "square.fill") { Button(action: {}) { Text("Button") } } Tab("Tab", systemImage: "square.fill") { Button(action: {}) { Text("Button") } } Tab("Tab", systemImage: "square.fill") { Button(action: {}) { Text("Button") } } Tab("Tab", systemImage: "square.fill") { Button(action: {}) { Text("Button") } } Tab("Tab", systemImage: "square.fill") { Button(action: {}) { Text("Button") } } TabSection("Section") { Tab("Tab", systemImage: "square.fill") { Button(action: {}) { Text("Button") } } Tab("Tab", systemImage: "square.fill") { Button(action: {}) { Text("Button") } } } }.tabViewStyle(.sidebarAdaptable) } } Am I using it wrong, or is this a bug?
1
0
419
Oct ’24
AVPlayerViewController (AppleTV) - Dolby (multi-channel audio) visualisation
We noticed that AVPlayerViewController does not always show the "Multi-channel" label in the audio setting in the player when playing a video asset with surround sound as an audio track. (see image) We only serve in the HLS master manifest a multichannel audio track, like this #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio_0",CHANNELS="6",NAME="Surround",LANGUAGE.... Different tvOS versions will give us different outcomes on whether or not the "multi-channel" label is shown DOES NOT SHOW (the label Multi-channel will not show) Model A1842 (tvOS v 17.5.1) Model A1625 (tvOS v 16.6) DOES SHOW (see image) Model A1625 (tvOS v 15.6) This gives us the impression that the label being shown depends on tvOS version.. Any reason why? This is an ideal way for the user to see that the audio track has surround..
0
1
489
Jul ’24
How to ensure current SKScene has fully loaded before engaging it with the GamePad Controller?
How to ensure current SKScene has fully loaded before engaging it with the GamePad Controller? The problem is this = when stopping sound is involved when I do switch SKScenes, if I press the buttons of the GamePad Controller (which cycle thru these other SKScenes) too fast, the movement of the Game Pieces fails to resume when I return to the Game Scene after the above cycling. This problem occurs only with the os(tvOS) version, but not with the iPad version. And the reason for this distinction is that each SKScene for the iPad has to fully load due to the fact that the button I press to switch SKScenes is at the top-left corner of the iPad -- so, by definition, by the time I have access to this button, the current SKScene has fully loaded. By definition, there is no such button for os(tvOS). Given this button’s absence, I believe I need the Swift version of jQuery’s $(document).ready (function() {. Any help will be appreciated to the rafters ...
2
0
549
Jul ’24
How to ensure current SKScene has fully loaded before engaging it with the GamePad Controller?
How to ensure current SKScene has fully loaded before engaging it with the GamePad Controller? MAJOR REWRITE FOR THE SAKE OF HOPEFULLY (?) INCREASED CLARITY The problem is this = when stopping sound is involved when I do switch SKScenes, if I press the buttons of the GamePad Controller (which cycle thru these other SKScenes) too fast, the movement of the Game Pieces fails to resume when I return to the Game Scene after the above cycling. This problem occurs only with the os(tvOS) version, but not with the iPad version. And the reason for this distinction is that each SKScene for the iPad has to fully load due to the fact that the button I press to switch SKScenes is at the top-left corner of the iPad -- so, by definition, by the time I have access to this button, the current SKScene has fully loaded. By definition, there is no such button for os(iOS). Given this button’s absence, I need the Swift version of jQuery’s $(document).ready (function() {. Any help will be appreciated to the rafters ...
1
0
507
Jul ’24
AppleTV Simulator SiriRemote not working in App
Hi, I'm having a small App in the AppleTV-Simulator which is supposed to use the Siri-Remotes Swipe-Gesture. It works perfect on the real device but on the simulator the Swipe-Gesture is not recognized in the App but it works on the Start-Screen of the Simulator using the simulated Siri-Remote app. Here is the code which sets up the xAxis ans yAxis value change handlers: #if targetEnvironment(simulator) // Simulator let siriRemote = GCController.controllers().filter { controller in if controller.vendorName == "Gamepad" { return true } else { return false } } let sController = siriRemote.first! let inputProfile = sController.physicalInputProfile let dPad = inputProfile.dpads["Direction Pad"] self.dPad = dPad self.dPad!.xAxis.valueChangedHandler = self.directionPadXAxisValueChangeHandler self.dPad!.yAxis.valueChangedHandler = self.directionPadYAxisValueChangeHandler } #else // Device if let _ = ( notification.object as? GCController)?.microGamepad { let microProfileController = notification.object as! GCController self.microGamePad = microProfileController.microGamepad self.dPad = self.microGamePad!.dpad self.dPad!.xAxis.valueChangedHandler = self.directionPadXAxisValueChangeHandler self.dPad!.yAxis.valueChangedHandler = self.directionPadYAxisValueChangeHandler } #endif Any help is greatly appreciated. Cheers, Frank
0
0
513
Jun ’24