Post

Replies

Boosts

Views

Activity

Reply to SwiftUI Text rendering with too small height / one line missing causing unexpected text truncation on iPhone devices
I can always reproduce this with any iPhone device or simulator with 2556x1179 screen for iOS 18.6, 26.4, and 26.5, but not on iOS 17.5. I didn't test other iOS versions so far. On my iPhone 15 device I have now reproduced again with 26.4.2 and earlier 26.4.1 I believe. macOS 26.4.1 (25E253) Xcode 26.5.0 beta 2 and beta 3 or Xcode 26.4.0 (17E192) I'm not sure what variable is different in your setup. In our main app this is part of an UICollectionView To confirm, you see the same result outside of a UIViewRepresentable as well? To make this more clear: Our main app is a bigger UICollectionViewController with UICollectionViewCell's with SwiftUI hosted content configuration. It happens here on the same devices (screen size) and horizontal padding of 20. No dynamic type involved here, because we have our own Typography system (creating Font and UIFont) with fixed font sizes and line heights. We now will ship a UILabel embedded in the same cell via UIViewRepresentable, which doesn't have this bug. So UIKit text rendering works in this context. My reduced sample requires either that the user has a dynamicTypeSize of medium (90% in UI, 3rd step in simulator accessibility setting) set on the device or simulator or to hardcode the dynamic type size in the sample via dynamicTypeSize(.medium). There's no UIViewRepresentable in this sample. I made a minimal swift file, which I run via the default iOS project template. import SwiftUI let txt = """ Es sollte die erste Japan-Tournee von vielen werden, kein anderes Land – abgesehen von Österreich und der Schweiz – bereisten die Berliner Philharmoniker häufiger. Wie kam es zu dem überschäumend herzlichen Empfang, der dem Orchester bei seinem ersten Gastspiel in Tokio bereitet wurde und wie wurde das Land zu einer »zweiten Heimat« für die Berliner? Ein konkreter historischer Grundstein für das hohe Ansehen klassischer Musik »made in Germany« in Japan wurde bereits im 19. Jahrhunderts gelegt: Als Teil von umfassenden gesellschaftlichen Modernisierungsmaßnahmen vergab die Regierung ab 1868 Stipendien an junge japanische Intellektuelle, damit diese an den besten internationalen Instituten studieren konnten. Berlin wurde – neben Wien – als globales Zentrum der Musik betrachtet, und so erhielten viele japanische Studierende um die Jahrhundertwende die Gelegenheit, von Komponisten wie etwa Max Bruch zu lernen. Zurück in der Heimat, teilten sie ihre Begeisterung für die europäische Kunstmusik sowie das Wissen um die instrumentale und kompositorische Praxis der klassisch-romantischen Tradition. """ @main struct TestRenderingApp: App { var body: some Scene { WindowGroup { Text(txt) .dynamicTypeSize(.medium) .fixedSize(horizontal: false, vertical: true) .padding(.horizontal, 20) } } } The raw text is: Es sollte die erste Japan-Tournee von vielen werden, kein anderes Land – abgesehen von Österreich und der Schweiz – bereisten die Berliner Philharmoniker häufiger. Wie kam es zu dem überschäumend herzlichen Empfang, der dem Orchester bei seinem ersten Gastspiel in Tokio bereitet wurde und wie wurde das Land zu einer »zweiten Heimat« für die Berliner? Ein konkreter historischer Grundstein für das hohe Ansehen klassischer Musik »made in Germany« in Japan wurde bereits im 19. Jahrhunderts gelegt: Als Teil von umfassenden gesellschaftlichen Modernisierungsmaßnahmen vergab die Regierung ab 1868 Stipendien an junge japanische Intellektuelle, damit diese an den besten internationalen Instituten studieren konnten. Berlin wurde – neben Wien – als globales Zentrum der Musik betrachtet, und so erhielten viele japanische Studierende um die Jahrhundertwende die Gelegenheit, von Komponisten wie etwa Max Bruch zu lernen. Zurück in der Heimat, teilten sie ihre Begeisterung für die europäische Kunstmusik sowie das Wissen um die instrumentale und kompositorische Praxis der klassisch-romantischen Tradition.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
6d
Reply to SwiftUI Text rendering with too small height / one line missing causing unexpected text truncation on iPhone devices
The first sample didn't reproduce on the simulator or device without an accessibility override, which I had active on my device, but forgot. The second sample always reproduces on an iPhone 15 device / sim with affected iOS. Did you test also with this second sample or only the sample code from the initial post? For an iPhone 15 sim the following OS give these results: 17.5 works 18.6 truncates 26.4 truncates 26.5 truncates So it's likely an iOS 18.x regression. To pinpoint this more it would be necessary to download more iOS 18 SDKs. Regarding devices it seems to need a device with 2556x1179 resolution. So an iPhone 16 also reproduces this issue. struct ContentView: View { var body: some View { Text(txt) .dynamicTypeSize(.medium) .fixedSize(horizontal: false, vertical: true) .padding(.horizontal, 20) .frame(maxHeight: .infinity) } } Whether you wrap that ContentView in a ScrollView or not doesn't affect the truncation in my tests. In our main app this is part of an UICollectionView so also scrollable and it's embedded via a UICollectionViewCell and hosted content configuration. As the long text is an important UI for our app we have no choice, but to try working around with UIKit UILabel / UITextView embedded as representable.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
1w
Reply to SwiftUI Text rendering with too small height / one line missing causing unexpected text truncation on iPhone devices
Thank you for the reply Travis. I know the view debugger, but I didn't see anything interesting there. A screenshot is below. However, your mention of Typography was a good hint. I actually had an accessibility font active on my iPhone device, but forgot about that. Note that this sample app is extracted from a bigger app, where we run into this issue where there's no dynamic type support. I also confirmed that changing the accessibility font size doesn't change the bug or font in the main app. With my sample I confirmed this happens with the default font / Font.body and DynamicTypeSize.medium. With that I can now also reproduce the issue in the iPhone simulator. struct ContentView: View { var body: some View { Text(txt) .dynamicTypeSize(.medium) .fixedSize(horizontal: false, vertical: true) .padding(.horizontal, 20) .frame(maxHeight: .infinity) } } View Debugger iPhone device screenshot View Debugger iPhone sim screenshot
Topic: UI Frameworks SubTopic: SwiftUI Tags:
2w
Reply to UICollectionView.CellRegistration and dequeueConfiguredReusableCell with nil for Item? causes runtime crash
Sorry, I made a mistake with my sample. ItemIdentifiers have to be unique and therefore non optional as per my previous comment. But a nil view model mapped from the ItemIdentifier should be supported. This is the updated sample code: class ViewController: UICollectionViewController { let crash: Bool = true @ViewLoading var dataSource: UICollectionViewDiffableDataSource<Int, Int> override func viewDidLoad() { super.viewDidLoad() let registration = UICollectionView.CellRegistration<UICollectionViewListCell, Int?> { cell, indexPath, itemIdentifier in var config = cell.defaultContentConfiguration() config.text = itemIdentifier.map { String($0) } ?? "nil" cell.contentConfiguration = config } dataSource = UICollectionViewDiffableDataSource(collectionView: self.collectionView) { [crash] collectionView, indexPath, itemIdentifier in let model: Int? = if crash { nil } else { itemIdentifier } return collectionView.dequeueConfiguredReusableCell(using: registration, for: indexPath, item: model) } var snapshot: NSDiffableDataSourceSnapshot<Int, Int> = .init() snapshot.appendSections([0]) snapshot.appendItems([1,2,3], toSection: 0) dataSource.apply(snapshot, animatingDifferences: true) } }
Topic: UI Frameworks SubTopic: UIKit Tags:
Feb ’25
Reply to UICollectionView.CellRegistration and dequeueConfiguredReusableCell with nil for Item? causes runtime crash
Here’s a sample project. After more thought it makes sense that nil or Optional is dangerous anyway. As there’s the case where two models would be nil and then the ItemIdentifier is no longer unique in a snapshot, which will also crash as it’s not supported. For Optional ItemIdentifier multiple nil values should have the same hash value so this will cause the issues. The documentation and APIs should probably be updated to mention the uniqueness requirements and that Optionals are not supported due to this. The fact that UICollectionViewDiffableDataSource can be defined with Optionals and that dequeueConfiguredReusableCell takes Item? seems like wrong API design to me now. class ViewController: UICollectionViewController { let crash: Bool = true @ViewLoading var dataSource: UICollectionViewDiffableDataSource<Int, Int?> override func viewDidLoad() { super.viewDidLoad() let registration = UICollectionView.CellRegistration<UICollectionViewListCell, Int?> { cell, indexPath, itemIdentifier in var config = cell.defaultContentConfiguration() config.text = itemIdentifier.map { String($0) } ?? "nil" cell.contentConfiguration = config } dataSource = UICollectionViewDiffableDataSource(collectionView: self.collectionView) { collectionView, indexPath, itemIdentifier in collectionView.dequeueConfiguredReusableCell(using: registration, for: indexPath, item: itemIdentifier) } var snapshot: NSDiffableDataSourceSnapshot<Int, Int?> = .init() snapshot.appendSections([0]) if crash { snapshot.appendItems([1,2,nil], toSection: 0) } else { snapshot.appendItems([1,2,3], toSection: 0) } dataSource.apply(snapshot, animatingDifferences: true) } } I also attached it to the feedback.
Topic: UI Frameworks SubTopic: UIKit Tags:
Feb ’25
Reply to Accessing "From my mac" in PhotoKit
I sync photos locally via Finder between Photos on macOS and Photos on iOS. I do not use iCloud for Photos, but only other data. I want to give some apps full access to my photo library. There’s a way to do this in iOS settings and via the prompt in an app, but the full access does not give permission to synced photos. Therefore currently with my new iPhone my library is empty in all third party apps besides a handful of new photos that I shot with the new iPhone. I can’t access my synced photos. For example, when I use the following sample code: https://developer.apple.com/documentation/photokit/browsing_and_modifying_photo_albums And make adjustments that were posted here then I can fetch synced albums and their names, but not a single asset of an synced album asset collection. If I change the permission in the iOS settings from full access to limited access and individually select photos from the synced album it works. But this doesn't scale for the entire photo library. I expect full access to be full access to all photos and not just photos from iCloud library or photos that were shot on this device. Another misleading thing is that in the iOS settings app under privacy -> photos there’s a list section „full access“, which shows photos synced from my mac that won’t be accessible in reality due to the bug. Below the text label says „11 photos, 3 videos“, which is correct and what's really accessible. My library has around 27k assets and besides those 14 assets they’re synced from macOS. I filed two feedbacks: FB13364538 FB13364521
Nov ’23
Reply to [iOS 16] AVAggregateAssetDownloadTask reports CoreMediaErrorDomain Code=-12640
I found out that we only have this issue with URLs that change over time due to the query parameter containing a token for expiring the URL and signing the URL. So if AVFoundation downloads the manifests multiple times with some time in between the token will change slightly due to the different timestamp. My company filed a DTS and they let us know that STABLE-VARIANT-ID (see also STABLE-RENDITION-ID) may fix this issue. When testing downloads with a Proxy that overrides manifests to include these stable identifiers as arguments we reduced the -12640 error a lot, but not completely. We got new errors instead however. But these occur still less often. So with these attributes AVAssetDownloadTask works better for us, but still fails from time to time. -15602 -16657 https://developer.apple.com/forums/thread/674090 https://stackoverflow.com/questions/66600288/avaggregateassetdownloadtask-error-domain-coremediaerrordomain-code-16657
Topic: Media Technologies SubTopic: Streaming Tags:
Feb ’23
Reply to [Orientation] BUG IN CLIENT OF UIKIT: Setting UIDevice.orientation is not supported. Please use UIWindowScene.requestGeometryUpdate(_:)
In iOS 16 the following code is deprecated: setValue(orientation.rawValue, forKey: "orientation") We had a working alternative using attemptRotationToDeviceOrientation(), but this then also got deprecated. Then requestGeometryUpdate() was introduced. We use UIWindowScene.requestGeometryUpdate() instead now. This worked for iOS 16. But from iOS 16.1 this isn’t working. To fix this we also now need to call UIViewController.setNeedsUpdateOfSupportedInterfaceOrientations() afterwards. The API documentation doesn’t mention the need to call setNeedsUpdateOfSupportedInterfaceOrientations. So it’s not clear if this is a workaround or the intended way to change the interface orientation. It would be nice to update the documentation to clarify the expected behavior and usage of requestGeometryUpdate() and setNeedsUpdateOfSupportedInterfaceOrientations().
Topic: App & System Services SubTopic: Core OS Tags:
Nov ’22
Reply to Has anyone been able to get SharePlay working with the iOS 14 beta 7 and the SharePlay development profile?
FYI: GroupStateObserver is refreshing isEligibleForGroupSession asynchronously. So it's not holding the correct value after initializing it. This isn't well documented. The way to use this is to hold an instance of GroupStateObserver somewhere. Keep in mind that the initial value won't be correct, when launching the app during a FaceTime call. You can use the publisher to be notified of updates. The publisher fires before the state updates (objectWillChange) and in next RunTime loop the Bool should be updated. In the WWDC session the observer is wrapped as @StateObject to only initialize the GroupStateObserver once during the view lifetime and to update the view, when the objectWillChange publisher of the GroupStateObserver fires. let eligible = GroupStateObserver().isEligibleForGroupSession // won't work, always false
Topic: App & System Services SubTopic: Core OS Tags:
Oct ’21
Reply to SwiftUI Text rendering with too small height / one line missing causing unexpected text truncation on iPhone devices
I can always reproduce this with any iPhone device or simulator with 2556x1179 screen for iOS 18.6, 26.4, and 26.5, but not on iOS 17.5. I didn't test other iOS versions so far. On my iPhone 15 device I have now reproduced again with 26.4.2 and earlier 26.4.1 I believe. macOS 26.4.1 (25E253) Xcode 26.5.0 beta 2 and beta 3 or Xcode 26.4.0 (17E192) I'm not sure what variable is different in your setup. In our main app this is part of an UICollectionView To confirm, you see the same result outside of a UIViewRepresentable as well? To make this more clear: Our main app is a bigger UICollectionViewController with UICollectionViewCell's with SwiftUI hosted content configuration. It happens here on the same devices (screen size) and horizontal padding of 20. No dynamic type involved here, because we have our own Typography system (creating Font and UIFont) with fixed font sizes and line heights. We now will ship a UILabel embedded in the same cell via UIViewRepresentable, which doesn't have this bug. So UIKit text rendering works in this context. My reduced sample requires either that the user has a dynamicTypeSize of medium (90% in UI, 3rd step in simulator accessibility setting) set on the device or simulator or to hardcode the dynamic type size in the sample via dynamicTypeSize(.medium). There's no UIViewRepresentable in this sample. I made a minimal swift file, which I run via the default iOS project template. import SwiftUI let txt = """ Es sollte die erste Japan-Tournee von vielen werden, kein anderes Land – abgesehen von Österreich und der Schweiz – bereisten die Berliner Philharmoniker häufiger. Wie kam es zu dem überschäumend herzlichen Empfang, der dem Orchester bei seinem ersten Gastspiel in Tokio bereitet wurde und wie wurde das Land zu einer »zweiten Heimat« für die Berliner? Ein konkreter historischer Grundstein für das hohe Ansehen klassischer Musik »made in Germany« in Japan wurde bereits im 19. Jahrhunderts gelegt: Als Teil von umfassenden gesellschaftlichen Modernisierungsmaßnahmen vergab die Regierung ab 1868 Stipendien an junge japanische Intellektuelle, damit diese an den besten internationalen Instituten studieren konnten. Berlin wurde – neben Wien – als globales Zentrum der Musik betrachtet, und so erhielten viele japanische Studierende um die Jahrhundertwende die Gelegenheit, von Komponisten wie etwa Max Bruch zu lernen. Zurück in der Heimat, teilten sie ihre Begeisterung für die europäische Kunstmusik sowie das Wissen um die instrumentale und kompositorische Praxis der klassisch-romantischen Tradition. """ @main struct TestRenderingApp: App { var body: some Scene { WindowGroup { Text(txt) .dynamicTypeSize(.medium) .fixedSize(horizontal: false, vertical: true) .padding(.horizontal, 20) } } } The raw text is: Es sollte die erste Japan-Tournee von vielen werden, kein anderes Land – abgesehen von Österreich und der Schweiz – bereisten die Berliner Philharmoniker häufiger. Wie kam es zu dem überschäumend herzlichen Empfang, der dem Orchester bei seinem ersten Gastspiel in Tokio bereitet wurde und wie wurde das Land zu einer »zweiten Heimat« für die Berliner? Ein konkreter historischer Grundstein für das hohe Ansehen klassischer Musik »made in Germany« in Japan wurde bereits im 19. Jahrhunderts gelegt: Als Teil von umfassenden gesellschaftlichen Modernisierungsmaßnahmen vergab die Regierung ab 1868 Stipendien an junge japanische Intellektuelle, damit diese an den besten internationalen Instituten studieren konnten. Berlin wurde – neben Wien – als globales Zentrum der Musik betrachtet, und so erhielten viele japanische Studierende um die Jahrhundertwende die Gelegenheit, von Komponisten wie etwa Max Bruch zu lernen. Zurück in der Heimat, teilten sie ihre Begeisterung für die europäische Kunstmusik sowie das Wissen um die instrumentale und kompositorische Praxis der klassisch-romantischen Tradition.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
6d
Reply to SwiftUI Text rendering with too small height / one line missing causing unexpected text truncation on iPhone devices
The first sample didn't reproduce on the simulator or device without an accessibility override, which I had active on my device, but forgot. The second sample always reproduces on an iPhone 15 device / sim with affected iOS. Did you test also with this second sample or only the sample code from the initial post? For an iPhone 15 sim the following OS give these results: 17.5 works 18.6 truncates 26.4 truncates 26.5 truncates So it's likely an iOS 18.x regression. To pinpoint this more it would be necessary to download more iOS 18 SDKs. Regarding devices it seems to need a device with 2556x1179 resolution. So an iPhone 16 also reproduces this issue. struct ContentView: View { var body: some View { Text(txt) .dynamicTypeSize(.medium) .fixedSize(horizontal: false, vertical: true) .padding(.horizontal, 20) .frame(maxHeight: .infinity) } } Whether you wrap that ContentView in a ScrollView or not doesn't affect the truncation in my tests. In our main app this is part of an UICollectionView so also scrollable and it's embedded via a UICollectionViewCell and hosted content configuration. As the long text is an important UI for our app we have no choice, but to try working around with UIKit UILabel / UITextView embedded as representable.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
1w
Reply to SwiftUI Text rendering with too small height / one line missing causing unexpected text truncation on iPhone devices
Thank you for the reply Travis. I know the view debugger, but I didn't see anything interesting there. A screenshot is below. However, your mention of Typography was a good hint. I actually had an accessibility font active on my iPhone device, but forgot about that. Note that this sample app is extracted from a bigger app, where we run into this issue where there's no dynamic type support. I also confirmed that changing the accessibility font size doesn't change the bug or font in the main app. With my sample I confirmed this happens with the default font / Font.body and DynamicTypeSize.medium. With that I can now also reproduce the issue in the iPhone simulator. struct ContentView: View { var body: some View { Text(txt) .dynamicTypeSize(.medium) .fixedSize(horizontal: false, vertical: true) .padding(.horizontal, 20) .frame(maxHeight: .infinity) } } View Debugger iPhone device screenshot View Debugger iPhone sim screenshot
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
2w
Reply to UICollectionView.CellRegistration and dequeueConfiguredReusableCell with nil for Item? causes runtime crash
Sorry, I made a mistake with my sample. ItemIdentifiers have to be unique and therefore non optional as per my previous comment. But a nil view model mapped from the ItemIdentifier should be supported. This is the updated sample code: class ViewController: UICollectionViewController { let crash: Bool = true @ViewLoading var dataSource: UICollectionViewDiffableDataSource<Int, Int> override func viewDidLoad() { super.viewDidLoad() let registration = UICollectionView.CellRegistration<UICollectionViewListCell, Int?> { cell, indexPath, itemIdentifier in var config = cell.defaultContentConfiguration() config.text = itemIdentifier.map { String($0) } ?? "nil" cell.contentConfiguration = config } dataSource = UICollectionViewDiffableDataSource(collectionView: self.collectionView) { [crash] collectionView, indexPath, itemIdentifier in let model: Int? = if crash { nil } else { itemIdentifier } return collectionView.dequeueConfiguredReusableCell(using: registration, for: indexPath, item: model) } var snapshot: NSDiffableDataSourceSnapshot<Int, Int> = .init() snapshot.appendSections([0]) snapshot.appendItems([1,2,3], toSection: 0) dataSource.apply(snapshot, animatingDifferences: true) } }
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Feb ’25
Reply to UICollectionView.CellRegistration and dequeueConfiguredReusableCell with nil for Item? causes runtime crash
Here’s a sample project. After more thought it makes sense that nil or Optional is dangerous anyway. As there’s the case where two models would be nil and then the ItemIdentifier is no longer unique in a snapshot, which will also crash as it’s not supported. For Optional ItemIdentifier multiple nil values should have the same hash value so this will cause the issues. The documentation and APIs should probably be updated to mention the uniqueness requirements and that Optionals are not supported due to this. The fact that UICollectionViewDiffableDataSource can be defined with Optionals and that dequeueConfiguredReusableCell takes Item? seems like wrong API design to me now. class ViewController: UICollectionViewController { let crash: Bool = true @ViewLoading var dataSource: UICollectionViewDiffableDataSource<Int, Int?> override func viewDidLoad() { super.viewDidLoad() let registration = UICollectionView.CellRegistration<UICollectionViewListCell, Int?> { cell, indexPath, itemIdentifier in var config = cell.defaultContentConfiguration() config.text = itemIdentifier.map { String($0) } ?? "nil" cell.contentConfiguration = config } dataSource = UICollectionViewDiffableDataSource(collectionView: self.collectionView) { collectionView, indexPath, itemIdentifier in collectionView.dequeueConfiguredReusableCell(using: registration, for: indexPath, item: itemIdentifier) } var snapshot: NSDiffableDataSourceSnapshot<Int, Int?> = .init() snapshot.appendSections([0]) if crash { snapshot.appendItems([1,2,nil], toSection: 0) } else { snapshot.appendItems([1,2,3], toSection: 0) } dataSource.apply(snapshot, animatingDifferences: true) } } I also attached it to the feedback.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Feb ’25
Reply to Accessing "From my mac" in PhotoKit
I sync photos locally via Finder between Photos on macOS and Photos on iOS. I do not use iCloud for Photos, but only other data. I want to give some apps full access to my photo library. There’s a way to do this in iOS settings and via the prompt in an app, but the full access does not give permission to synced photos. Therefore currently with my new iPhone my library is empty in all third party apps besides a handful of new photos that I shot with the new iPhone. I can’t access my synced photos. For example, when I use the following sample code: https://developer.apple.com/documentation/photokit/browsing_and_modifying_photo_albums And make adjustments that were posted here then I can fetch synced albums and their names, but not a single asset of an synced album asset collection. If I change the permission in the iOS settings from full access to limited access and individually select photos from the synced album it works. But this doesn't scale for the entire photo library. I expect full access to be full access to all photos and not just photos from iCloud library or photos that were shot on this device. Another misleading thing is that in the iOS settings app under privacy -> photos there’s a list section „full access“, which shows photos synced from my mac that won’t be accessible in reality due to the bug. Below the text label says „11 photos, 3 videos“, which is correct and what's really accessible. My library has around 27k assets and besides those 14 assets they’re synced from macOS. I filed two feedbacks: FB13364538 FB13364521
Replies
Boosts
Views
Activity
Nov ’23
Reply to [iOS 16] AVAggregateAssetDownloadTask reports CoreMediaErrorDomain Code=-12640
I found out that we only have this issue with URLs that change over time due to the query parameter containing a token for expiring the URL and signing the URL. So if AVFoundation downloads the manifests multiple times with some time in between the token will change slightly due to the different timestamp. My company filed a DTS and they let us know that STABLE-VARIANT-ID (see also STABLE-RENDITION-ID) may fix this issue. When testing downloads with a Proxy that overrides manifests to include these stable identifiers as arguments we reduced the -12640 error a lot, but not completely. We got new errors instead however. But these occur still less often. So with these attributes AVAssetDownloadTask works better for us, but still fails from time to time. -15602 -16657 https://developer.apple.com/forums/thread/674090 https://stackoverflow.com/questions/66600288/avaggregateassetdownloadtask-error-domain-coremediaerrordomain-code-16657
Topic: Media Technologies SubTopic: Streaming Tags:
Replies
Boosts
Views
Activity
Feb ’23
Reply to [Orientation] BUG IN CLIENT OF UIKIT: Setting UIDevice.orientation is not supported. Please use UIWindowScene.requestGeometryUpdate(_:)
In iOS 16 the following code is deprecated: setValue(orientation.rawValue, forKey: "orientation") We had a working alternative using attemptRotationToDeviceOrientation(), but this then also got deprecated. Then requestGeometryUpdate() was introduced. We use UIWindowScene.requestGeometryUpdate() instead now. This worked for iOS 16. But from iOS 16.1 this isn’t working. To fix this we also now need to call UIViewController.setNeedsUpdateOfSupportedInterfaceOrientations() afterwards. The API documentation doesn’t mention the need to call setNeedsUpdateOfSupportedInterfaceOrientations. So it’s not clear if this is a workaround or the intended way to change the interface orientation. It would be nice to update the documentation to clarify the expected behavior and usage of requestGeometryUpdate() and setNeedsUpdateOfSupportedInterfaceOrientations().
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Nov ’22
Reply to Has anyone been able to get SharePlay working with the iOS 14 beta 7 and the SharePlay development profile?
FYI: GroupStateObserver is refreshing isEligibleForGroupSession asynchronously. So it's not holding the correct value after initializing it. This isn't well documented. The way to use this is to hold an instance of GroupStateObserver somewhere. Keep in mind that the initial value won't be correct, when launching the app during a FaceTime call. You can use the publisher to be notified of updates. The publisher fires before the state updates (objectWillChange) and in next RunTime loop the Bool should be updated. In the WWDC session the observer is wrapped as @StateObject to only initialize the GroupStateObserver once during the view lifetime and to update the view, when the objectWillChange publisher of the GroupStateObserver fires. let eligible = GroupStateObserver().isEligibleForGroupSession // won't work, always false
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Oct ’21