Platforms to show: All Mac Windows Linux Cross-Platform
PHFetchOptionsMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | Photos | MBS Mac64bit Plugin | 20.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
Using class methods on the PHAssetMBS, PHCollectionMBS, PHAssetCollectionMBS, and PHCollectionListMBS classes to fetch assets or collections produces a PHFetchResultMBS object containing the requested objects. The options you specify control which objects the fetch result includes, how those objects are arranged in the fetch result, and how Photos should notify your app of changes to the fetch result.
Photos supports only a restricted set of keys for the predicate and sortDescriptors properties. The set of available keys depends on which class you’re using to fetch assets or collections—see Table 1 for the list of keys supported by each class.
Supported predicate and sort descriptor keys
Class for Fetch Method | Supported Keys |
PHAsset | SELF, localIdentifier, creationDate, modificationDate, mediaType, mediaSubtypes, duration, pixelWidth, pixelHeight, favorite (or isFavorite), hidden (or isHidden), burstIdentifier |
PHAssetCollection | SELF, localIdentifier, localizedTitle (or title), startDate, endDate, estimatedAssetCount |
PHCollectionList | SELF, localIdentifier, localizedTitle (or title), startDate, endDate |
PHCollection (can fetch a mix of PHCollectionList and PHAssetCollection objects) | SELF, localIdentifier, localizedTitle (or title), startDate, endDate |
Available in MacOS 10.13 or newer.
- 7 properties
- property fetchLimit as Integer
- property Handle as Integer
- property includeAllBurstAssets as Boolean
- property includeAssetSourceTypes as Integer
- property includeHiddenAssets as Boolean
- property predicate as NSPredicateMBS
- property wantsIncrementalChangeDetails as Boolean
- 4 methods
- method Constructor
- method copy as PHFetchOptionsMBS
- method setSortDescriptors(sortDescriptors() as NSSortDescriptorMBS)
- method sortDescriptors as NSSortDescriptorMBS()
- shared method available as boolean
This class has no sub classes.
Some methods using this class:
- PHAssetCollectionMBS.fetchAssetCollectionsWithALAssetGroupURLs(assetGroupURLs() as string, options as PHFetchOptionsMBS = nil) as PHFetchResultMBS
- PHAssetCollectionMBS.fetchAssetCollectionsWithLocalIdentifiers(identifiers() as string, options as PHFetchOptionsMBS = nil) as PHFetchResultMBS
- PHAssetMBS.fetchAssets(options as PHFetchOptionsMBS = nil) as PHFetchResultMBS
- PHAssetMBS.fetchAssetsInAssetCollection(assetCollection as PHAssetCollectionMBS, options as PHFetchOptionsMBS = nil) as PHFetchResultMBS
- PHAssetMBS.fetchAssetsWithBurstIdentifier(burstIdentifier as String, options as PHFetchOptionsMBS = nil) as PHFetchResultMBS
- PHAssetMBS.fetchAssetsWithLocalIdentifiers(identifiers() as String, options as PHFetchOptionsMBS = nil) as PHFetchResultMBS
- PHAssetMBS.fetchKeyAssetsInAssetCollection(assetCollection as PHAssetCollectionMBS, options as PHFetchOptionsMBS = nil) as PHFetchResultMBS
- PHCollectionListMBS.fetchCollectionListsContainingCollection(collection as PHCollectionMBS, options as PHFetchOptionsMBS = nil) as PHFetchResultMBS
- PHCollectionListMBS.fetchCollectionListsWithLocalIdentifiers(identifiers() as string, options as PHFetchOptionsMBS = nil) as PHFetchResultMBS
- PHCollectionListMBS.fetchCollectionListsWithType(collectionListType as Integer, subtype as Integer, options as PHFetchOptionsMBS = nil) as PHFetchResultMBS
The items on this page are in the following plugins: MBS Mac64bit Plugin.
PHContentEditingOutputMBS - PHFetchResultChangeDetailsMBS