Embed the Photos Picker in your app

RSS for tag

Discuss the WWDC23 Session Embed the Photos Picker in your app

View Session

Posts under wwdc2023-10107 tag

4 Posts
Sort by:
Post marked as solved
3 Replies
1.3k Views
Using the new inline PhotosPicker style in iOS 17, it isn't made clear how to handle the cancel button's input, and i cannot seem to find an answer in the documentation. PhotosPicker( "Select picture", selection: $selected, selectionBehavior: .default, photoLibrary: .shared() ) .photosPickerStyle(.inline) Does anybody have a solution or is this a bug that needs to be fixed?
Posted
by TobiasF.
Last updated
.
Post not yet marked as solved
1 Replies
447 Views
I use loadFileRepresentation to register video URL. After that, loadItem will take less time to see the video from the picker. But after upgrade Iphone to 16.6, this func can not work. Have any change or dev team removed loadItem it? Here is my sample code: provider.loadItem(forTypeIdentifier: "public.movie", options: nil) { url, error in guard let url = url as? URL else { return } self.parent.selectedVideoURL = url // Check cached, if loadFileRepresentation before use url from loadItem more faster let storage = LocalStorageHelper() if storage.checkStringExistStorage(MEDIA_PICKER_STORAGE_NAMESPACE, url.relativeString) { DispatchQueue.main.async { self.parent.presentationMode.wrappedValue.dismiss() self.parent.videoURL = url } } else { provider.loadFileRepresentation(forTypeIdentifier: "public.movie") { urlResult, error in DispatchQueue.main.async { self.parent.presentationMode.wrappedValue.dismiss() } if let error = error { // Handle errors loading video LOGGING.error("Error loading video: \(error.localizedDescription)") return } guard let urlFile = urlResult else {return} // create a new filename let fileName = "\(Int(Date().timeIntervalSince1970)).\(urlFile.pathExtension)" // create new URL let newUrl = URL(fileURLWithPath: NSTemporaryDirectory() + fileName) // copy item to APP Storage try? FileManager.default.copyItem(at: urlFile, to: newUrl) DispatchQueue.main.async { storage.saveStringToStorage(MEDIA_PICKER_STORAGE_NAMESPACE, url.relativeString) self.parent.videoURL = URL(string: newUrl.absoluteString) } } } }
Posted Last updated
.
Post not yet marked as solved
0 Replies
341 Views
I noticed that in iOS 17, when zoom in photos in System's Photo App, a crop button appears in the upper right corner of the screen. I wonder that if user can use this function in the embedded photo picker in third-party apps to transfer cropped photos to third-party apps, instead of transfer complete photos to third-party apps and then crop these photos in third-party apps. Thanks a lot!
Posted
by T3210X.
Last updated
.
Post not yet marked as solved
1 Replies
726 Views
In the WWDC talk about the new embedded photo picker, the presenter says "If you want to implement your own replacement for some picker features, use the ".photosPicker DisabledCapabilities" modifier" (https://developer.apple.com/videos/play/wwdc2023/10107/?time=270). However, he did not demonstrate how to do so. For example, I want to use the compact version of the photo picker, with the header hidden, and place a custom "Add" button to use instead. Additionally, using any version of the picker, how could I add a button to the toolbar where "add" and "cancel" are? Is it possible to apply styling to the existing toolbar buttons, for instance changing the text color? Thanks!
Posted
by npav.
Last updated
.