A read-only proxy representing a Photos asset or collection object yet to be created by a change request.
- iOS 8+
- macOS 10.15+
- Mac Catalyst 13.0+
- tvOS 10+
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 be created.
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
local property and use it to fetch the actual object. Alternatively, because the
PHObject class implements the
hash methods in terms of its
local property, you can also find the object for a placeholder using techniques that depend on these methods.