Platforms to show: All Mac Windows Linux Cross-Platform
Back to PHAssetCollectionChangeRequestMBS class.
PHAssetCollectionChangeRequestMBS.addAsset(asset as PHAssetMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Photos | MBS Mac64bit Plugin | 20.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
asset: The PHAsset object to be added to the asset collection.
If you created the change request with a snapshot of the asset collection’s contents using the changeRequestForAssetCollection method, Photos inserts the new assets after the existing assets in the collection. Otherwise, the arrangement of the new assets relative to others in the collection is undefined.
Assets from My Photo Stream or iCloud Shared Albums and assets synced to the device through iTunes cannot be added to collections. Transient asset collections (such as those created with the transientAssetCollectionWithAssets method) do not support adding or removing content.
PHAssetCollectionChangeRequestMBS.addAssets(assets() as PHAssetMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Photos | MBS Mac64bit Plugin | 20.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
assets: An array of PHAsset objects to be added to the asset collection.
If you created the change request with a snapshot of the asset collection’s contents using the changeRequestForAssetCollection method, Photos inserts the new assets after the existing assets in the collection. Otherwise, the arrangement of the new assets relative to others in the collection is undefined.
Assets from My Photo Stream or iCloud Shared Albums and assets synced to the device through iTunes cannot be added to collections. Transient asset collections (such as those created with the transientAssetCollectionWithAssets method) do not support adding or removing content.
PHAssetCollectionChangeRequestMBS.Constructor
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Photos | MBS Mac64bit Plugin | 20.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
PHAssetCollectionChangeRequestMBS.insertAsset(asset as PHAssetMBS, index as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Photos | MBS Mac64bit Plugin | 20.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
asset: A PHAssetMBS object to be inserted into the asset collection.
index: The index at which the asset should be inserted. The count of locations in this index set must equal the count of assets.
To ensure that the index set you specify is valid even if the asset collection has changed since you fetched it, create a change request with a snapshot of the asset collection’s contents using the changeRequestForAssetCollection method before inserting assets.
For a detailed discussion of how the index set you specify maps to insertions in the list of assets, see the similar NSMutableArray method insertObjects.
Assets from My Photo Stream or iCloud Shared Albums and assets synced to the device through iTunes cannot be added to collections. Transient asset collections (such as those created with the transientAssetCollectionWithAssets method) do not support adding or removing content.
PHAssetCollectionChangeRequestMBS.insertAssets(assets() as PHAssetMBS, indexes as NSIndexSetMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Photos | MBS Mac64bit Plugin | 20.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
assets: An array of PHAssetMBS objects to be inserted into the asset collection.
indexes: The indexes at which the assets should be inserted. The count of locations in this index set must equal the count of assets.
To ensure that the index set you specify is valid even if the asset collection has changed since you fetched it, create a change request with a snapshot of the asset collection’s contents using the changeRequestForAssetCollection method before inserting assets.
For a detailed discussion of how the index set you specify maps to insertions in the list of assets, see the similar NSMutableArray method insertObjects.
Assets from My Photo Stream or iCloud Shared Albums and assets synced to the device through iTunes cannot be added to collections. Transient asset collections (such as those created with the transientAssetCollectionWithAssets method) do not support adding or removing content.
PHAssetCollectionChangeRequestMBS.moveAsset(fromIndex as Integer, toIndex as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Photos | MBS Mac64bit Plugin | 20.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
fromIndex: The indexes of the asset to be moved in the asset collection.
toIndex: The index at which to place the moved asset, relative to the collection’s ordering after removing the items at indexes.
When you call this method, Photos first removes the items in the indexes parameter from the collection, and then inserts them at the location specified by the toIndex parameter.
To ensure that the index set you specify is valid even if the asset collection has changed since you fetched it, create a change request with a snapshot of the asset collection’s contents using the changeRequestForAssetCollection method before rearranging assets.
PHAssetCollectionChangeRequestMBS.moveAssets(fromIndexes as NSIndexSetMBS, toIndex as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Photos | MBS Mac64bit Plugin | 20.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
fromIndexes: The indexes of the assets to be moved in the asset collection.
toIndex: The index at which to place the moved assets, relative to the collection’s ordering after removing the items at indexes.
When you call this method, Photos first removes the items in the indexes parameter from the collection, and then inserts them at the location specified by the toIndex parameter.
To ensure that the index set you specify is valid even if the asset collection has changed since you fetched it, create a change request with a snapshot of the asset collection’s contents using the changeRequestForAssetCollection method before rearranging assets.
PHAssetCollectionChangeRequestMBS.removeAsset(asset as PHAssetMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Photos | MBS Mac64bit Plugin | 20.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
asset: A PHAssetMBS object to be removed from the asset collection.
This method removes assets from the collection based on their identity (determined by the localIdentifier property of each asset). To remove objects at specified indexes, use the removeAssets method.
Transient asset collections (such as those created with the transientAssetCollectionWithAssets:title: method) do not support adding or removing content.
See also:
PHAssetCollectionChangeRequestMBS.removeAsset(AtIndex as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Photos | MBS Mac64bit Plugin | 20.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
index: The index of the asset to be removed from the asset collection.
To ensure that the index set you specify is valid even if the asset collection has changed since you fetched it, create a change request with a snapshot of the asset collection’s contents using the changeRequestForAssetCollection method before removing assets. To remove objects based on their identities (without regard to their indexes in the collection), use the removeAssets: method.
Transient asset collections (such as those created with the transientAssetCollectionWithAssets method) do not support adding or removing content.
See also:
PHAssetCollectionChangeRequestMBS.removeAssets(assets() as PHAssetMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Photos | MBS Mac64bit Plugin | 20.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
assets: An array of PHAssetMBS objects to be removed from the asset collection.
This method removes assets from the collection based on their identity (determined by the localIdentifier property of each asset). To remove objects at specified indexes, use the removeAssets method.
Transient asset collections (such as those created with the transientAssetCollectionWithAssets:title: method) do not support adding or removing content.
See also:
PHAssetCollectionChangeRequestMBS.removeAssets(AtIndexes as NSIndexSetMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Photos | MBS Mac64bit Plugin | 20.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
indexes: The indexes of the assets to be removed from the asset collection.
To ensure that the index set you specify is valid even if the asset collection has changed since you fetched it, create a change request with a snapshot of the asset collection’s contents using the changeRequestForAssetCollection method before removing assets. To remove objects based on their identities (without regard to their indexes in the collection), use the removeAssets: method.
Transient asset collections (such as those created with the transientAssetCollectionWithAssets method) do not support adding or removing content.
See also:
PHAssetCollectionChangeRequestMBS.replaceAsset(AtIndex as Integer, asset as PHAssetMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Photos | MBS Mac64bit Plugin | 20.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
index: The index of the asset to be replaced in the asset collection.
asset: A PHAssetMBS object to be inserted into (or moved within) the asset collection.
To ensure that the index set you specify is valid even if the asset collection has changed since you fetched it, create a change request with a snapshot of the asset collection’s contents using the changeRequestForAssetCollection method before rearranging assets.
Assets from My Photo Stream or iCloud Shared Albums and assets synced to the device through iTunes cannot be added to collections. Transient asset collections (such as those created with the transientAssetCollectionWithAssets method) do not support adding or removing content.
PHAssetCollectionChangeRequestMBS.replaceAssets(AtIndexes as NSIndexSetMBS, assets() as PHAssetMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Photos | MBS Mac64bit Plugin | 20.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
indexes: The indexes of the assets to be replaced in the asset collection.
assets: An array of PHAssetMBS objects to be inserted into (or moved within) the asset collection.
To ensure that the index set you specify is valid even if the asset collection has changed since you fetched it, create a change request with a snapshot of the asset collection’s contents using the changeRequestForAssetCollection method before rearranging assets.
Assets from My Photo Stream or iCloud Shared Albums and assets synced to the device through iTunes cannot be added to collections. Transient asset collections (such as those created with the transientAssetCollectionWithAssets method) do not support adding or removing content.
The items on this page are in the following plugins: MBS Mac64bit Plugin.