-
Handle the Limited Photos Library in your app
Access the photos and videos you need for your app while preserving privacy. With the new Limited Photos Library feature, people can directly control which photos and videos an app can access to protect their private content. We'll explore how this feature may affect your app, and take you through alternatives like PHPicker.
Check out “Meet the New Photos Picker” to learn more about PHPicker and how this this fully private picker can help you avoid requiring full Photos Library access in your app.Recursos
Vídeos relacionados
WWDC23
WWDC21
WWDC20
-
Buscar neste vídeo...
-
-
8:36 - Query for authorization status
import Photos let accessLevel: PHAccessLevel = .readWrite let authorizationStatus = PHPhotoLibrary.authorizationStatus(for: accessLevel) switch authorizationStatus { case .limited: print("limited authorization granted") default: //FIXME: Implement handling for all authorizationStatus values print("Not implemented") } -
9:43 - Request read/write authorization
import Photos let requiredAccessLevel: PHAccessLevel = .readWrite PHPhotoLibrary.requestAuthorization(for: requiredAccessLevel) { authorizationStatus in switch authorizationStatus { case .limited: print("limited authorization granted") default: //FIXME: Implement handling for all authorizationStatus print("Unimplemented") } } -
12:04 - Present the limited library management UI
import PhotosUI let library = PHPhotoLibrary.shared() let viewController = self library.presentLimitedLibraryPicker(from: viewController)
-