Platforms to show: All Mac Windows Linux Cross-Platform
PHAssetMBS class
Super class: PHObjectMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | Photos | MBS Mac64bit Plugin | 20.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
You fetch assets to begin working with them. Use the class methods listed in Fetching Assets to retrieve one or more PHAsset instances representing the assets you want to display or edit.
Assets contain only metadata. The underlying image or video data for any given asset might not be stored on the local device. However, depending on how you plan to use this data, you may not need to download all of it. If you need to populate a collection view with thumbnail images, the Photos framework can manage downloading, generating, and caching thumbnails for each asset. For details, see PHImageManagerMBS.
Asset objects are immutable. To edit an asset’s metadata (such as marking it as a favorite photo), create a PHAssetChangeRequestMBS object within a photo library change block. For more details on using change requests and change blocks to update the photo library, see PHPhotoLibraryMBS.
Subclass of the PHObjectMBS class.
This is an abstract class. You can't create an instance, but you can get one from various plugin functions.
- 19 properties
- property adjustmentFormatIdentifier as String New in 25.1
- property burstIdentifier as String
- property burstSelectionTypes as Integer
- property creationDate as Date
- property creationDateTime as DateTime
- property duration as Double
- property Favorite as Boolean
- property hasAdjustments as Boolean New in 25.1
- property Hidden as Boolean
- property location as Variant
- property mediaSubtypes as Integer
- property mediaType as Integer
- property modificationDate as Date
- property modificationDateTime as DateTime
- property pixelHeight as Integer
- property pixelWidth as Integer
- property playbackStyle as Integer
- property RepresentsBurst as Boolean
- property sourceType as Integer
- 4 methods
- method cancelContentEditingInputRequest(requestID as Integer)
- method canPerformEditOperation(editOperation as Integer) as Boolean
- method Constructor Private
- method requestContentEditingInputWithOptions(options as PHContentEditingInputRequestOptionsMBS, CompletionDelegate as RequestContentEditingInputWithOptionsCompletedMBS, tag as variant = nil) as Integer
- 10 shared methods
- shared method available as boolean
- shared method fetchAssets(options as PHFetchOptionsMBS = nil) as PHFetchResultMBS
- shared method fetchAssetsInAssetCollection(assetCollection as PHAssetCollectionMBS, options as PHFetchOptionsMBS = nil) as PHFetchResultMBS
- shared method fetchAssetsWithBurstIdentifier(burstIdentifier as String, options as PHFetchOptionsMBS = nil) as PHFetchResultMBS
- shared method fetchAssetsWithLocalIdentifiers(identifiers() as String, options as PHFetchOptionsMBS = nil) as PHFetchResultMBS
- shared method fetchAssetsWithMediaType(mediaType as Integer, options as PHFetchOptionsMBS = nil) as PHFetchResultMBS
- shared method fetchKeyAssetsInAssetCollection(assetCollection as PHAssetCollectionMBS, options as PHFetchOptionsMBS = nil) as PHFetchResultMBS
- shared method PHContentEditingInputCancelledKey as String
- shared method PHContentEditingInputErrorKey as String
- shared method PHContentEditingInputResultIsInCloudKey as String
- delegate RequestContentEditingInputWithOptionsCompletedMBS(Asset as PHAssetMBS, Options as PHContentEditingInputRequestOptionsMBS, tag as variant, contentEditingInput as PHContentEditingInputMBS, info as Dictionary)
- 31 constants
Burst Selection Type
Constant | Value | Description |
---|---|---|
BurstSelectionTypeAutoPick | 1 |
Photos has automatically identified the asset as a potential user favorite. |
BurstSelectionTypeNone | 0 |
The asset is not marked as a favorite member of its burst sequence or is not a member of a burst sequence. |
BurstSelectionTypeUserPick | 2 |
The user has marked the asset as a favorite member of its burst sequence. |
Edit Operations
Constant | Value | Description |
---|---|---|
EditOperationContent | 2 |
The asset’s photo or video content can be edited. |
EditOperationDelete | 1 |
The asset can be deleted from the photo library. |
EditOperationProperties | 3 |
The asset’s metadata properties can be edited. |
Media Subtypes
Constant | Value | Description |
---|---|---|
MediaSubtypeNone | 0 |
The asset has no subtype. This is the default subtype for most photo and video assets. |
MediaSubtypePhotoDepthEffect | 16 |
The asset is a photo captured with the Camera app's Portrait mode depth effect. |
MediaSubtypePhotoHDR | 2 |
The asset is a High Dynamic Range photo. |
MediaSubtypePhotoLive | 8 | The asset is a Live Photo that includes movement and sounds from the moments just before and after its capture. more |
MediaSubtypePhotoPanorama | 1 |
The asset is a large-format panorama photo. |
MediaSubtypePhotoScreenshot | 4 |
The asset is an image captured with the device’s screenshot feature. |
MediaSubtypeSpatialMedia | 1024 |
The asset is a spatial video. |
MediaSubtypeVideoCinematic | &h200000 |
The asset is a cinematic video. |
MediaSubtypeVideoHighFrameRate | &h20000 |
The asset is a high-frame-rate video. High-frame-rate videos are created by the Slow-Mo feature in the Camera app on an iOS device. |
MediaSubtypeVideoStreamed | &h10000 | The asset is a video whose contents are always streamed over a network connection. more |
MediaSubtypeVideoTimelapse | &h40000 |
The asset is a time-lapse video. |
Media Types
Constant | Value | Description |
---|---|---|
MediaTypeAudio | 3 |
The asset is an audio file. |
MediaTypeImage | 1 |
The asset is a photo or other static image. |
MediaTypeUnknown | 0 |
The asset’s type is unknown. |
MediaTypeVideo | 2 |
The asset is a video file. |
Asset Playback Styles
Constant | Value | Description |
---|---|---|
PlaybackStyleImage | 1 |
The asset should be displayed as a still image. |
PlaybackStyleImageAnimated | 2 |
The asset should be displayed as an animated image. |
PlaybackStyleLivePhoto | 3 |
The asset should be displayed as a Live Photo. |
PlaybackStyleUnsupported | 0 |
The asset has an unsupported or undefined media playback type. |
PlaybackStyleVideo | 4 |
The asset should be displayed as a video. |
PlaybackStyleVideoLooping | 5 |
The asset should be displayed as a looping video. |
Source Types
Constant | Value | Description |
---|---|---|
SourceTypeCloudShared | 2 |
The asset originates from an iCloud Shared Album. Assets from shared albums cannot be edited and do not appear in Moments collections. |
SourceTypeiTunesSynced | 4 |
The asset originates from a Mac or PC and is present on the device through iTunes sync. iTunes-synced assets cannot be edited or deleted. |
SourceTypeNone | 0 |
Source information is not available for the asset. |
SourceTypeUserLibrary | 1 | The asset is part of the user’s main Photos library. more |
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.
Blog Entries
Release notes
- Version 25.1
- Added hasAdjustments and adjustmentFormatIdentifier properties to PHAssetMBS class.
- Added more constants to PHAssetMBS, PHAssetCollectionMBS and PHAssetCreationRequestMBS classes.
Some methods using this class:
- PHAssetCollectionChangeRequestMBS.addAsset(asset as PHAssetMBS)
- PHAssetCollectionChangeRequestMBS.insertAsset(asset as PHAssetMBS, index as Integer)
- PHAssetCollectionChangeRequestMBS.insertAssets(assets() as PHAssetMBS, indexes as NSIndexSetMBS)
- PHAssetCollectionChangeRequestMBS.removeAssets(assets() as PHAssetMBS)
- PHAssetCollectionChangeRequestMBS.replaceAsset(AtIndex as Integer, asset as PHAssetMBS)
- PHAssetCollectionChangeRequestMBS.replaceAssets(AtIndexes as NSIndexSetMBS, assets() as PHAssetMBS)
- PHAssetCollectionMBS.transientAssetCollectionWithAssets(assets() as PHAssetMBS, title as string) as PHAssetCollectionMBS
- PHImageManagerMBS.RequestImageDataAndOrientationForAsset(asset as PHAssetMBS, options as PHImageRequestOptionsMBS, CompletionHandler as RequestImageForAssetCompletedMBS, tag as Variant = nil) as Integer
- PHImageManagerMBS.RequestImageForAsset(asset as PHAssetMBS, targetSize as CGSizeMBS, contentMode as Integer, options as PHImageRequestOptionsMBS, CompletionHandler as RequestImageForAssetCompletedMBS, tag as Variant = nil) as Integer
- PHImageManagerMBS.RequestLivePhotoForAsset(asset as PHAssetMBS, targetSize as CGSizeMBS, contentMode as Integer, options as PHLivePhotoRequestOptionsMBS, CompletionHandler as RequestLivePhotoForAssetCompletedMBS, tag as Variant = nil) as Integer
Some properties using for this class:
- PHProjectChangeRequestMBS.keyAsset as PHAssetMBS
Some examples using this class:
Some related classes:
- class CGSizeMBS
- class NSIndexSetMBS
- class PHAssetCollectionChangeRequestMBS
- class PHAssetCollectionMBS
- class PHAssetCreationRequestMBS
- class PHFetchOptionsMBS
- class PHFetchResultMBS
- class PHLivePhotoRequestOptionsMBS
- class PHObjectMBS
- class PHPhotoLibraryMBS
The items on this page are in the following plugins: MBS Mac64bit Plugin.
PHAssetCreationRequestMBS - PHAssetResourceCreationOptionsMBS
