Post

Replies

Boosts

Views

Activity

Reply to UITab memory leak
Moff, I confirm that on my side the unreleased reference also comes from _UIFloatingTabBarItemView. Richard, as to why my hack didn't work for Moff, it is definitely related to the version of iPadOS. iPadOS 18.7.1 (physical iPad): there is an additional unreleased reference to the tab bar view controller from a _UIFloatingTabBarItemCell. However my hack works. iPadOS 26.2 (simulator): there's only one reference from a _UIFloatingTabBarItemView, exactly as you described (same memory graph as yours). And indeed my hack doesn't work I hope the issue will be fixed for both versions of iPadOS. Please keep us posted here.
Topic: UI Frameworks SubTopic: UIKit
Feb ’26
Reply to UITab memory leak
I've just run into this issue and I can confirm that the memory leak does not occur on iPhone (iOS 18.7.1 and iOS 26) even when using UITabs occurs on iPad (iOS 18.7.1) only when using UITabs. It does not occur when setting the tab bar controller children the old way (setViewControllers(:animated:)). A work around is to use a custom TabBarController inheriting from UITabBarController and override viewDidDisappear(:) as follows: override func viewDidDisappear(_ animated: Bool) { super.viewDidDisappear(animated) // HACK: clear the tabs property to prevent memory leaks when using UITabs if #available(iOS 18, *) { setTabs([], animated: false) } } It effectively triggers the children view controllers deinit. App build with Xcode 26.2 on macOS 26.2.
Topic: UI Frameworks SubTopic: UIKit
Feb ’26
Reply to Offline Fairplay Error -42650
Some of our end-users experience the same issue with offline content keys. We had to disable content key persistence support until we fix the issue. I even reproduced it once myself with a valid (ie. not expired) offline content key: once providing the offline content key to the AVKeyRequest, the system immediately fails the AVPlayerItem (no automatic retry at AVContentKeySession level) with error CoreMediaErrorDomain:-42650. It is systematic and can only be solved by deleting the offline content key from the app content key store (which forces the app to retrieve a new content key from the KSM). Unfortunately, offline content keys lease duration being 30 days, it is not easy to reproduce the issue and provide logs. Could Apple provide more information on this error specifically and on CoreMediaErrorDomain errors in general? The lack of documentation is very annoying and developers can only empirically list errors when they occur (examples: https://developerinsider.co/fairplay-streaming-error-codes/, https://developer.bitmovin.com/playback/docs/system-error-codes-ios).
Topic: Media Technologies SubTopic: Streaming Tags:
Jul ’25
Reply to AVPlayer periodic time observer stops notifying when switching back from AirPlay to local playback
Actually the problem is even worse: the AVPlayer.currentTime() does not change anymore after the playback transitions from AirPlay (to an Apple TV) to local despite the playback still ongoing. Also, it's worth noting that when the issue occurs, AVPlayer.currentDate() is properly updated. So the problem is probably not related to the periodic time observation but rather to the AVPlayer.currentTime() not being updated anymore when switching from AirPlay to local playback.
Topic: Media Technologies SubTopic: Streaming Tags:
Apr ’25
Reply to CoreMediaErrorDomain -12034 and -12158
Have you received any feedback from Apple or even found out what was the problem? It may not be related but I'm currently having a CoreMediaErrorDomain -12035 error using the same AV adapter when streaming FairPlay-protected content but only on iOS 18+. It works fine on iOS 17.7. https://developer.apple.com/forums/thread/770159
Topic: Media Technologies SubTopic: Streaming Tags:
Dec ’24
Reply to iOS/tvOS seem to reuse closed sockets
Many thanks for your reply. I indeed ended up with the two changes: For HTTP 1.1 requests, I added the "Connection: close" request header For HTTP 2 requests, I implemented the (empirical) detection of such errors and a one-time retry Both changes allow the app to either avoid the issue (1) or seamlessly handle it (2). Unfortunately, it does not help with the related issue (which is fortunately far less systematic) as the requests fail several (tens of) seconds after the dataTask is sent, time during which the user waits for his action to be performed or information to be displayed. But maybe this related issue is not as related as I think...
Topic: App & System Services SubTopic: General Tags:
Feb ’23
Reply to Can we show lockscreen media controls without playing a media on the phone but casting to Smart TVs/Streaming boxes?
Apple documentation indicates that it is supported (https://developer.apple.com/documentation/mediaplayer/handling_external_player_events_notifications) but I haven not found any sample code nor been able to make it work my self. My goal is to allow the user to control the GoogleCast playback from the CommandCenter.
Dec ’22
Reply to tvOS 15 - Cell registration inside a diffable data source cell provider exception
Thanks azhukov for your response. To give a bit of context, the content displayed by our app is mostly defined by the data the app receives from our backend (including the content hierarchy). It does not know beforehand which kinds of cells it will be asked to display. Most of the screens are base on the very same UIViewController (embedding a collectionView) which is highly configurable and controlled by the server data. For now we use 8 different cells types but it regularly increases as we include more various types of content, hence ways to present it. Our cells registrations lazy instantiation are global and are done once and for all; these instantiations are not local to a UIViewController (in the viewDidLoad() as you assumed). Moreover, the collectionView data describes the cells to use for each section and it makes no sense to parse the data before building the data source in order to force the lazy instantiation of cells registration that will be used. Finally, the cell registrations being only necessary in the UICollectionViewDiffableDataSource cell provider block, it seems absurd to instantiate all cell registrations beforehand whereas only some of them may be used during the app lifetime.      // sections cells registration     dataSource = UICollectionViewDiffableDataSource<Section, SectionItem>(collectionView: collectionView) { collectionView, indexPath, item in       let cellRegistration = item.section.widgetConfig.tileConfig.type.cellRegistration // lazily instantiated       return collectionView.dequeueConfiguredReusableCell(using: cellRegistration, for: indexPath, item: item)     } Instantiating objects once and for all and only when required to is definitely a good practice, just as are Swift class properties. And forbidding cell registrations instantiation inside a diffableDataSource cell provider block seems to me a false good idea introduced in iOS/tvOS 15.
Topic: UI Frameworks SubTopic: General Tags:
Sep ’21
Reply to UITab memory leak
Moff, I confirm that on my side the unreleased reference also comes from _UIFloatingTabBarItemView. Richard, as to why my hack didn't work for Moff, it is definitely related to the version of iPadOS. iPadOS 18.7.1 (physical iPad): there is an additional unreleased reference to the tab bar view controller from a _UIFloatingTabBarItemCell. However my hack works. iPadOS 26.2 (simulator): there's only one reference from a _UIFloatingTabBarItemView, exactly as you described (same memory graph as yours). And indeed my hack doesn't work I hope the issue will be fixed for both versions of iPadOS. Please keep us posted here.
Topic: UI Frameworks SubTopic: UIKit
Replies
Boosts
Views
Activity
Feb ’26
Reply to UITab memory leak
I've just run into this issue and I can confirm that the memory leak does not occur on iPhone (iOS 18.7.1 and iOS 26) even when using UITabs occurs on iPad (iOS 18.7.1) only when using UITabs. It does not occur when setting the tab bar controller children the old way (setViewControllers(:animated:)). A work around is to use a custom TabBarController inheriting from UITabBarController and override viewDidDisappear(:) as follows: override func viewDidDisappear(_ animated: Bool) { super.viewDidDisappear(animated) // HACK: clear the tabs property to prevent memory leaks when using UITabs if #available(iOS 18, *) { setTabs([], animated: false) } } It effectively triggers the children view controllers deinit. App build with Xcode 26.2 on macOS 26.2.
Topic: UI Frameworks SubTopic: UIKit
Replies
Boosts
Views
Activity
Feb ’26
Reply to OSLogMessage string interpolation thread-safeness wise
Thanks Quinn for your answer. Everything makes sense now and we are relieved that you confirmed that the arguments evaluation is done in the logging call thread.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jul ’25
Reply to Offline Fairplay Error -42650
Some of our end-users experience the same issue with offline content keys. We had to disable content key persistence support until we fix the issue. I even reproduced it once myself with a valid (ie. not expired) offline content key: once providing the offline content key to the AVKeyRequest, the system immediately fails the AVPlayerItem (no automatic retry at AVContentKeySession level) with error CoreMediaErrorDomain:-42650. It is systematic and can only be solved by deleting the offline content key from the app content key store (which forces the app to retrieve a new content key from the KSM). Unfortunately, offline content keys lease duration being 30 days, it is not easy to reproduce the issue and provide logs. Could Apple provide more information on this error specifically and on CoreMediaErrorDomain errors in general? The lack of documentation is very annoying and developers can only empirically list errors when they occur (examples: https://developerinsider.co/fairplay-streaming-error-codes/, https://developer.bitmovin.com/playback/docs/system-error-codes-ios).
Topic: Media Technologies SubTopic: Streaming Tags:
Replies
Boosts
Views
Activity
Jul ’25
Reply to AVPlayer periodic time observer stops notifying when switching back from AirPlay to local playback
I have reported the issue with Feedback assistant: https://feedbackassistant.apple.com/feedback/17172515 I have also included a sample project allowing to easily reproduce the issue.
Topic: Media Technologies SubTopic: Streaming Tags:
Replies
Boosts
Views
Activity
Apr ’25
Reply to AVPlayer periodic time observer stops notifying when switching back from AirPlay to local playback
Actually the problem is even worse: the AVPlayer.currentTime() does not change anymore after the playback transitions from AirPlay (to an Apple TV) to local despite the playback still ongoing. Also, it's worth noting that when the issue occurs, AVPlayer.currentDate() is properly updated. So the problem is probably not related to the periodic time observation but rather to the AVPlayer.currentTime() not being updated anymore when switching from AirPlay to local playback.
Topic: Media Technologies SubTopic: Streaming Tags:
Replies
Boosts
Views
Activity
Apr ’25
Reply to Vibrancy effect not applied to context menu UIImages rendered in template mode
Sure: https://feedbackassistant.apple.com/feedback/16902752
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Mar ’25
Reply to CoreMediaErrorDomain -12035 error when playing a Fairplay-protected HLS stream on iOS 18+ through the Apple lightning AV Adapter
Thanks for your response. I filed a bug report on Feedback Assistant with the following id: FB16047318 (CoreMediaErrorDomain -12035 error when playing a Fairplay-protected HLS stream on iOS 18+ through the Apple lightning AV Adapter).
Topic: Media Technologies SubTopic: Video Tags:
Replies
Boosts
Views
Activity
Dec ’24
Reply to CoreMediaErrorDomain -12034 and -12158
Have you received any feedback from Apple or even found out what was the problem? It may not be related but I'm currently having a CoreMediaErrorDomain -12035 error using the same AV adapter when streaming FairPlay-protected content but only on iOS 18+. It works fine on iOS 17.7. https://developer.apple.com/forums/thread/770159
Topic: Media Technologies SubTopic: Streaming Tags:
Replies
Boosts
Views
Activity
Dec ’24
Reply to iOS 17 Opening the color picker results in an permanently visible PKToolBar
Same logs when opening the share sheet on iOS 17.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Sep ’23
Reply to iOS/tvOS seem to reuse closed sockets
Many thanks for your reply. I indeed ended up with the two changes: For HTTP 1.1 requests, I added the "Connection: close" request header For HTTP 2 requests, I implemented the (empirical) detection of such errors and a one-time retry Both changes allow the app to either avoid the issue (1) or seamlessly handle it (2). Unfortunately, it does not help with the related issue (which is fortunately far less systematic) as the requests fail several (tens of) seconds after the dataTask is sent, time during which the user waits for his action to be performed or information to be displayed. But maybe this related issue is not as related as I think...
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Feb ’23
Reply to Can we show lockscreen media controls without playing a media on the phone but casting to Smart TVs/Streaming boxes?
Apple documentation indicates that it is supported (https://developer.apple.com/documentation/mediaplayer/handling_external_player_events_notifications) but I haven not found any sample code nor been able to make it work my self. My goal is to allow the user to control the GoogleCast playback from the CommandCenter.
Replies
Boosts
Views
Activity
Dec ’22
Reply to Unable to validate/distribute a tvOS app with a TVTopShelf extension
Turns out the Xcode "Validate App" action does not provide an explicit error whereas the "Distribute App" action does. And I've been able to fix my issue: the TV Top Shelf executable name in its Info.plist did not match the bundle folder name.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Apr ’22
Reply to TVCollectionViewFullScreenLayout
Issue reported to Apple with the Feedback Assistant: FB9650519.
Topic: UI Frameworks SubTopic: General Tags:
Replies
Boosts
Views
Activity
Sep ’21
Reply to tvOS 15 - Cell registration inside a diffable data source cell provider exception
Thanks azhukov for your response. To give a bit of context, the content displayed by our app is mostly defined by the data the app receives from our backend (including the content hierarchy). It does not know beforehand which kinds of cells it will be asked to display. Most of the screens are base on the very same UIViewController (embedding a collectionView) which is highly configurable and controlled by the server data. For now we use 8 different cells types but it regularly increases as we include more various types of content, hence ways to present it. Our cells registrations lazy instantiation are global and are done once and for all; these instantiations are not local to a UIViewController (in the viewDidLoad() as you assumed). Moreover, the collectionView data describes the cells to use for each section and it makes no sense to parse the data before building the data source in order to force the lazy instantiation of cells registration that will be used. Finally, the cell registrations being only necessary in the UICollectionViewDiffableDataSource cell provider block, it seems absurd to instantiate all cell registrations beforehand whereas only some of them may be used during the app lifetime.      // sections cells registration     dataSource = UICollectionViewDiffableDataSource<Section, SectionItem>(collectionView: collectionView) { collectionView, indexPath, item in       let cellRegistration = item.section.widgetConfig.tileConfig.type.cellRegistration // lazily instantiated       return collectionView.dequeueConfiguredReusableCell(using: cellRegistration, for: indexPath, item: item)     } Instantiating objects once and for all and only when required to is definitely a good practice, just as are Swift class properties. And forbidding cell registrations instantiation inside a diffableDataSource cell provider block seems to me a false good idea introduced in iOS/tvOS 15.
Topic: UI Frameworks SubTopic: General Tags:
Replies
Boosts
Views
Activity
Sep ’21