You're using APIs from the iOS 14 beta that were replaced in the final release. That's why the environment value doesn't exist.
From the iOS 14 release notes: - https://developer.apple.com/documentation/ios-ipados-release-notes/ios-ipados-14-release-notes
The ImportFilesAction and ExportFilesAction APIs have been replaced
with a collection of new view modifiers. Use the new .fileImporter() modifier to present a system interface for
importing one or more files into your app, and the new .fileMover()
modifier to move one or more existing files to a new location. The
following is an example of a simple UI for importing and moving files: Use the new .fileExporter() modifier to present a system interface for
exporting one or more documents from your app. In this example, an app
provides a simple note-taking interface for quickly jotting down some
text and then exporting it to disk: struct QuickNote : View {
		@Binding var draft: QuickNoteDocument
		@State private var isExporting: Bool = false
		var body: some View {
				TextEditor(text: $draft.text)
						.toolbar {
								Button("Save", action: { isExporting = true })
						}
						.fileExporter(
								isPresented: $isExporting,
								document: draft,
								contentType: .plainText,
								defaultFilename: "MyNote"
						) { result in
								// Clear the draft now that it's saved.
								if case .success = result {
										draft.text = ""
								} else {
										// Handle failure.
								}
						}
		}
}
struct QuickNoteDocument : FileDocument {
		static var readableContentTypes: [UTType] { [.plainText] }
		var text: String
		init(text: String) {
				self.text = text
		}
		init(configuration: ReadConfiguration) throws {
				// Deserialize the document.
		}
		func fileWrapper(configuration: WriteConfiguration) throws -> FileWrapper {
				// Serialize the document.
		}
}
Post
Replies
Boosts
Views
Activity
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
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().
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
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