Pregunta

What's the purpose of the placeholderItem property in the UIActivityItemProvider class?

All the documentation states is the following:

An object that can stand in for the actual object you plan to create. The contents of the object may be empty but the class of the object must match the class of the object you plan to provide later.

What I'm curious about is how this property is actually used internally. Does this show up at any point in the UI?

¿Fue útil?

Solución

From the UIActivityItemProvider.h header,

placeHolder is the return value for -activityViewControllerPlaceholderItem:

Where -activityViewControllerPlaceholderItem: is a method of the UIActivityItemSource protocol, which UIActivityItemProvider implements.

The documentation for this method in the same header states:

called to determine data type. only the class of the return type is consulted. it should match what -itemForActivityType: returns later

Also, this thread on the Apple developer forums also sheds some light on how the placeholderItem is used.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top