Platforms to show: All Mac Windows Linux Cross-Platform

PHAssetCollectionMBS class

Super class: PHCollectionMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Photos MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
A representation of a Photos asset grouping, such as a moment, user-created album, or smart album.

In the Photos framework, collection objects (including asset collections) do not directly reference their member objects, and there are no other objects that directly reference collection objects. To retrieve the members of an asset collection, fetch them with a PHAsset class method such as fetchAssetsInAssetCollection. To find asset collections, use one of the methods listed in Fetching Asset Collections.

Important
Accessing or modifying the Photos library requires explicit authorization from the user. The first time you call one of the methods listed in Fetching Asset Collections, Photos automatically prompts the user for authorization. (Alternatively, you can use the PHPhotoLibraryMBS.requestAuthorization method to prompt the user at a time of your choosing.)

Your app’s Info.plist file must provide a value for the NSPhotoLibraryUsageDescription key that explains to the user why your app is requesting Photos access. Apps linked on or after iOS 10.0 will crash if this key is not present.

Like assets and collection lists, asset collections are immutable. To create, rename, or delete asset collections, or to add, remove, or rearrange members in an asset collection, create a PHAssetCollectionChangeRequestMBS object within a photo library change block. For details on using change requests and change blocks to update the photo library, see PHPhotoLibraryMBS.
Subclass of the PHCollectionMBS class.

SubTypes

Constant Value Description
SubtypeAlbumCloudShared 101 An iCloud Shared Photo Stream.
SubtypeAlbumImported 6 An album imported from a camera or external storage.
SubtypeAlbumMyPhotoStream 100 The user’s personal iCloud Photo Stream.
SubtypeAlbumRegular 2 An album created in the Photos app.
SubtypeAlbumSyncedAlbum 5 An album synced to the device from iPhoto.
SubtypeAlbumSyncedEvent 3 An Event synced to the device from iPhoto.
SubtypeAlbumSyncedFaces 4 A Faces group synced to the device from iPhoto.
SubtypeAny -1 A bit mask representing all possible subtypes.
SubtypeSmartAlbumAllHidden 205 A smart album that groups all assets hidden from the Moments view in the Photos app.
SubtypeSmartAlbumAnimated 214 A smart album that groups all image animation assets.
SubtypeSmartAlbumBursts 207 A smart album that groups all burst photo sequences in the photo library.
SubtypeSmartAlbumDepthEffect 212 A smart album that groups all images captured using the Depth Effect camera mode on compatible devices.
SubtypeSmartAlbumFavorites 203 A smart album that groups all assets that the user has marked as favorites.
SubtypeSmartAlbumGeneric 200 A smart album of no more specific subtype.
SubtypeSmartAlbumLivePhotos 213 A smart album that groups all Live Photo assets.
SubtypeSmartAlbumLongExposures 215 A smart album that groups all Live Photo assets where the Long Exposure variation is enabled.
SubtypeSmartAlbumPanoramas 201 A smart album that groups all panorama photos in the photo library.
SubtypeSmartAlbumRecentlyAdded 206 A smart album that groups assets that were recently added to the photo library.
SubtypeSmartAlbumScreenshots 211 A smart album that groups all images captured using the device’s screenshot function.
SubtypeSmartAlbumSelfPortraits 210 A smart album that groups all photos and videos captured using the device’s front-facing camera.
SubtypeSmartAlbumSlomoVideos 208 A smart album that groups all Slow-Mo videos in the photo library.
SubtypeSmartAlbumTimelapses 204 A smart album that groups all time-lapse videos in the photo library.
SubtypeSmartAlbumUnableToUpload 216 Unable to upload album.
SubtypeSmartAlbumUserLibrary 209 A smart album that groups all assets that originate in the user’s own library (as opposed to assets from iCloud Shared Albums).
SubtypeSmartAlbumVideos 202 A smart album that groups all video assets in the photo library.

Types

Constant Value Description
TypeAlbum 1 An album in the Photos app.
TypeMoment 3 A moment in the Photos app. Deprecated by Apple.
TypeSmartAlbum 2 A smart album whose contents update dynamically.

Super class PHCollectionMBS

Edit Operations

Constant Value Description
EditOperationAddContent 3 The collection supports adding items that already exist elsewhere in the photo library.
EditOperationCreateContent 4 The collection supports creating new items.
EditOperationDelete 6 The collection itself can be deleted.
EditOperationDeleteContent 1 The collection supports deleting the items it contains.
EditOperationRearrangeContent 5 The collection supports reordering the arrangement of items it contains.
EditOperationRemoveContent 2 The collection supports removing the items it contains.
EditOperationRename 7 The collection itself can be renamed.

Super class PHObjectMBS

Sub classes:

Some methods using this class:

Some examples using this class:

Blog Entries


The items on this page are in the following plugins: MBS Mac64bit Plugin.


PHAssetCollectionChangeRequestMBS   -   PHAssetCreationRequestMBS


The biggest plugin in space...