How to use CoreSpotlight categories?

In the CoreSpotlight headers there are various categories on CSSearchableItemAttributeSet, like CSSearchableItemAttributeSet_Places.h, CSSearchableItemAttributeSet_General.h etc.


I can use all these properties from the different categories but I don't understand how to designate a search result as a Place or an Event etc.


Does this work by assigning a specific content type in `-initWithItemContentType:`? If yes, which ones are supported? And can I combine categories such as places and events (an event almost always is associated to a place)?


What is needed to display the call and directions buttons for a search result?

Replies

No clarification on this? Wondering the same thing

I tried with CSSearchableItemAttributeSet(itemContentType: kUTTypeMessage as String), but the results returned are just *authorNames* no textContent or recipients were displayed.

As per Apple documentation :

For navigation use @property(copy, nullable) NSNumber*supportsNavigation of CSSearchableItemAttributeSet Class Reference

When an item includes

latitude
and
longitude
properties, these properties can be used for navigation to the location represented by the item. For example, it makes sense to set
supportsNavigation
to
1
for an item that represents review for a specific restaurant, but not for an item that represents a photo of a person.


For phonenumbers use @property(copy, nullable) NSNumber*supportsPhoneCall of CSSearchableItemAttributeSet Class Reference

When an item includes the

phoneNumbers
property, the phone number can be used to initiate phone calls. You can use the
supportsPhoneCall
property to indicate when making a phone call is appropriate and likely to be a primary action for the user. For example, you might set
supportsPhoneCall
to
1
for an item that represents a business, but not for an item that represents an academic paper that lists the phone numbers of the authors or the institution.

@guhan0, I also noticed the addition of supportsNavigation and supportsPhoneCall in a recent beta. However, this still doesn't answer the question which contentType should be used and which of the properties in the various CSSearchableItemAttributeSet categories are actually displayed.


Also, it seems that supportsNavigation and supportsPhoneCall are mutually exclusive.