Contents

PHObjectPlaceholder

A read-only proxy object that represents a Photos asset or collection to create.

Declaration

class PHObjectPlaceholder

Mentioned in

Overview

You obtain object placeholders when you use change requests to create assets, collections, or collection lists. After the change request completes, you can use the object placeholder to fetch the newly created object. You can also use an object placeholder to make additional change requests involving the object to create.

For example, the following code uses a placeholder to add a newly created asset to an album.

A placeholder always has the same local identifier as the asset, collection, or collection list that it represents. To find the object that corresponds to a placeholder, read the placeholder’s localIdentifier property and use it to fetch the actual object. Alternatively, because the PHObjectPlaceholder class implements the == and hash methods in terms of its localIdentifier property, you can also find the object for a placeholder using techniques that depend on these methods.

See Also

Updating the Library