The NSUserInterfaceItemSearching protocol show an application can implement Spotlight for Help for their own custom help data.


In general, users find the Help search functionality very useful. However, many large applications don't use Apple Help API because of cross platform requirements. Hence, important Help topics are not presented as part of the Help menu. This API allows developers to incorporate their own Help topics and take full advantage of the Help feature.

In your application you implement the NSUserInterfaceItemSearching protocol and then register your object with registerUserInterfaceItemSearchHandler(_:).


Show Help Menu

func localizedTitles(forItem: Any)

Returns an array of localized strings that will form the help menu item.

func showAllHelpTopics(forSearch: String)

If this method is implemented, a "Show All Help Topics" item will appear in the menu and this method is called when the user selects it.

Search Help Content

func searchForItems(withSearch: String, resultLimit: Int, matchedItemHandler: ([Any]) -> Void)

Search for the specified items, with the result limit.

func performAction(forItem: Any)

Invoked when the user selects a search result in Help menu.


Inherits From