tvOS is the operating system for Apple TV.

Posts under tvOS tag

86 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Implementing Enhanced Dialogue on tvOS 18
How does a third party developer go about supporting the new Enhanced Dialogue option for video apps in tvOS 18? If an app is using the standard AVPlayerViewController, I had assumed it would be a simple-ish matter of building against the tvOS 18 SDK but apparently not, the options don't appear, not even greyed out.
0
0
367
Sep ’24
[tvOS 18][SwiftUI] Severe ScrollView Lag after Update
Hello, I've upgraded both of my Apple TVs to tvOS 18. Since then, my app developed with SwiftUI has become almost unusable due to severe lag, particularly when scrolling in a LazyVStack. On the A1625 (Apple TV HD), the lag can last up to 20 seconds, while on the A2843 (Apple TV 4K, 3rd generation, Wi-Fi + Ethernet), it’s about one second. I can consistently reproduce the issue with this minimal example: @main struct MyApp: App { var body: some Scene { WindowGroup { ScrollView { LazyVStack { ForEach(0..<1000) { nb in Button("Item \(nb)") {} } } } } } } Using Instruments, I found that the hang is related to this call: 389.00 ms 71,4 % 6.00 ms +[_UIFocusRegionEvaluator __regionsByEvaluatingOcclusionsForBaseRegions:occludingRegions:baseRegionsCanOccludeEachOther:inSnapshot:] Unfortunately, I can't attach the Instruments trace directly here, but you can download it from this link: https://drive.google.com/file/d/1sEIwXhr7_ajjRHZevCIW6jNOlPjaeU6L/view?usp=sharing Important notes: The same screen, when written in UIKit, runs smoothly on both devices. After performing a factory reset on the older device, the performance issue disappeared. However, as you can imagine, I’m already receiving complaints from users who are understandably unwilling to reset their devices. Does anyone know of a workaround until this is addressed by Apple?
3
1
621
Oct ’24
TvOS18 Simulator is crashing with collectionview dequeue
After updating Xcode to version-16 and TVOS Simulator to version-18, It started crashing at collectionview dequeue cell. Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Expected dequeued view to be returned to the collection view in preparation for display. When the collection view's data source is asked to provide a view for a given index path, ensure that a single view is dequeued and returned to the collection view. Avoid dequeuing views without a request from the collection view. Only happening with tvOS18 simulator, it is working fine with tvos17 simulator and Real Device with TvOS18.
4
3
1k
Oct ’24
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
358
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
453
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
666
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
442
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
724
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
539
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
374
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
372
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
366
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.5k
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
506
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
407
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
1
476
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
547
Jul ’24