Platforms to show: All Mac Windows Linux Cross-Platform
PHCollectionListMBS 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 |
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 a collection list, fetch them with a PHCollectionMBS class method such as fetchCollectionsInCollectionList. To find objects at the root of the collection list hierarchy (such as album folders with no parent folders), use the fetchTopLevelUserCollectionsWithOptions method.
Accessing or modifying the Photos library requires explicit authorization from the user. The first time you call one of the methods listed in Fetching Collection Lists, 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 asset collections, collection lists are immutable. To create, rename, or delete collection lists, or to add, remove, or rearrange members in a collection list, create a PHCollectionListChangeRequestMBS 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.
- 6 properties
- property collectionListSubtype as Integer
- property collectionListType as Integer
- property endDate as Date
- property endDateTime as DateTime
- property startDate as Date
- property startDateTime as DateTime
- 2 methods
- method Constructor
- method localizedLocationNames as String()
- 6 shared methods
- shared method available as boolean
- shared method fetchCollectionListsContainingCollection(collection as PHCollectionMBS, options as PHFetchOptionsMBS = nil) as PHFetchResultMBS
- shared method fetchCollectionListsWithLocalIdentifiers(identifiers() as string, options as PHFetchOptionsMBS = nil) as PHFetchResultMBS
- shared method fetchCollectionListsWithType(collectionListType as Integer, subtype as Integer, options as PHFetchOptionsMBS = nil) as PHFetchResultMBS
- shared method transientCollectionListWithCollections(collections() as PHCollectionMBS, title as String) as PHCollectionListMBS
- shared method transientCollectionListWithCollectionsFetchResult(fetchResult as PHFetchResultMBS, title as String) as PHCollectionListMBS
- 9 constants
Sub Types
Constant | Value | Description |
---|---|---|
SubtypeAny | -1 |
Use this value to fetch collection lists of all possible subtypes. |
SubtypeMomentListCluster | 1 |
The collection list is a moment cluster, grouping several related moments. |
SubtypeMomentListYear | 2 |
The collection list is a moment year, grouping all moments from one or more calendar years. |
SubtypeRegularFolder | 100 |
The collection list is a folder containing albums or other folders. |
SubtypeSmartFolderEvents | 200 |
The collection list is a smart folder containing one or more Events synced from iPhoto. |
SubtypeSmartFolderFaces | 201 |
The collection list is a smart folder containing one or more Faces synced from iPhoto. |
Types
Constant | Value | Description |
---|---|---|
TypeFolder | 2 |
A folder containing asset collections of type PHAssetCollectionTypeAlbum or PHAssetCollectionTypeSmartAlbum. |
TypeMomentList | 1 | A group of asset collections of type PHAssetCollectionTypeMoment. more |
TypeSmartFolder | 3 |
A smart folder synced to the device. |
Super class PHCollectionMBS
- 3 properties
- property canContainAssets as Boolean
- property canContainCollections as Boolean
- property localizedTitle as String
- 2 methods
- method canPerformEditOperation(anOperation as Integer) as Boolean
- method Constructor
- 3 shared methods
- shared method available as boolean
- shared method fetchCollectionsInCollectionList(collectionList as PHCollectionListMBS, options as PHFetchOptionsMBS = nil) as PHFetchResultMBS
- shared method fetchTopLevelUserCollections(options as PHFetchOptionsMBS = nil) as PHFetchResultMBS
- 7 constants
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
- 2 properties
- property Handle as Integer
- property localIdentifier as String
- 2 methods
- method Constructor Private
- method copy as PHObjectMBS
- shared method available as boolean
This class has no sub classes.
Some methods using this class:
- PHAssetCollectionChangeRequestMBS.deleteAssetCollections(Collections() as PHCollectionListMBS)
- PHCollectionListChangeRequestMBS.changeRequestForCollectionList(collectionList as PHCollectionListMBS) as PHCollectionListChangeRequestMBS
- PHCollectionListChangeRequestMBS.changeRequestForCollectionList(collectionList as PHCollectionListMBS, childCollections as PHFetchResultMBS) as PHCollectionListChangeRequestMBS
- PHCollectionListChangeRequestMBS.deleteCollectionLists(collectionLists() as PHCollectionListMBS)
- PHCollectionMBS.fetchCollectionsInCollectionList(collectionList as PHCollectionListMBS, options as PHFetchOptionsMBS = nil) as PHFetchResultMBS
Some examples using this class:
The items on this page are in the following plugins: MBS Mac64bit Plugin.
PHCollectionListChangeRequestMBS - PHCollectionMBS