Platforms to show: All Mac Windows Linux Cross-Platform
PHPhotoLibraryMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | Photos | MBS Mac64bit Plugin | 20.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
The shared PHPhotoLibraryMBS object represents the entire set of assets and collections managed by the Photos app, including both assets stored on the local device and (if enabled) those stored in iCloud Photos. You use this object for the following tasks:
- Getting or verifying the user's permission for your app to access Photos content.
- Making changes to assets and collections; for example, editing asset metadata or content, inserting new assets, or rearranging the members of a collection.
- Registering for update messages sent when changes are made to the library.
Requires MacOS 10.13 or newer.
- 2 events
- event DidBecomeUnavailable
- event DidChange(changes as PHChangeMBS)
- 2 properties
- property Handle as Integer
- property unavailabilityReason as NSErrorMBS
- 5 methods
- method cloudIdentifiersForLocalIdentifiers(localIdentifiers() as String) as PHCloudIdentifierMBS()
- method Constructor
- method Destructor
- method localIdentifiersForCloudIdentifiers(cloudIdentifiers() as PHCloudIdentifierMBS) as String()
- method performChanges(ChangeBlock as ChangeBlockMBS, CompletionHandler as ChangeCompletionHandlerMBS, tag as Variant = nil)
- 8 shared methods
- shared method authorizationStatus as Integer
- shared method authorizationStatusForAccessLevel(accessLevel as Integer) as Integer New in 25.1
- shared method available as boolean
- shared method PHLocalIdentifierNotFound as String
- shared method PHPhotosErrorDomain as String
- shared method requestAuthorization(CompletionHandler as RequestAuthorizationCompletedMBS, tag as Variant = nil)
- shared method requestAuthorizationForAccessLevel(accessLevel as Integer, CompletionHandler as RequestAuthorizationCompletedMBS, tag as Variant = nil) New in 25.1
- shared method sharedPhotoLibrary as PHPhotoLibraryMBS
- 2 delegates
- delegate ChangeBlockMBS(tag as Variant)
- delegate ChangeCompletionHandlerMBS(success as boolean, error as NSErrorMBS, tag as Variant)
- 11 constants
Access Levels
Constant | Value | Description |
---|---|---|
PHAccessLevelAddOnly | 1 |
You can only add photos. |
PHAccessLevelReadWrite | 2 |
You can read and write. |
Authorization Status
Constant | Value | Description |
---|---|---|
PHAuthorizationStatusAuthorized | 3 |
The user has explicitly granted your app access to the photo library. |
PHAuthorizationStatusDenied | 2 |
The user has explicitly denied your app access to the photo library. |
PHAuthorizationStatusNotDetermined | 0 |
Explicit user permission is required for photo library access, but the user has not yet granted or denied such permission. |
PHAuthorizationStatusRestricted | 1 |
Your app is not authorized to access the photo library, and the user cannot grant such permission. |
Errors
Constant | Value | Description |
---|---|---|
PHPhotosErrorInvalid | -1 |
Invalid error? |
PHPhotosErrorLibraryVolumeOffline | 3114 |
Library volume offline. |
PHPhotosErrorRelinquishingLibraryBundleToWriter | 3142 |
Relinquishing library bundle to writer |
PHPhotosErrorSwitchingSystemPhotoLibrary | 3143 |
Failed to switch system photo library. |
PHPhotosErrorUserCancelled | 3072 |
The user cancelled. |
This class has no sub classes.
Blog Entries
- MBS Xojo Plugins, version 25.1pr7
- New in the MBS Xojo Plugins Version 20.2
- Show Live Photos in your Xojo application
Videos
Release notes
- Version 25.1
- Added requestAuthorizationForAccessLevel and authorizationStatusForAccessLevel methods for PHPhotoLibraryMBS class.
Some examples using this class:
Some related classes:
The items on this page are in the following plugins: MBS Mac64bit Plugin.
PHObjectPlaceholderMBS - PHPickerConfigurationMBS
