Spotlight extension in ios 9

2019-06-19 22:09发布

问题:

I've downloaded Xcode 7 beta and found a new type of extension there. On WWDC 2015 nothing was said about it. It's called Spotligt extension. When Spotlight Extension in iOS 9 is called and for what it's used?

回答1:

From iOS 9.0:

App Search in iOS 9 gives users great new ways to access information inside of your app, even when it isn’t installed. When you adopt iOS 9 Search, users can access activities and content deep within your app through Handoff, Siri Reminders, and Search results.

and

Spotlight extension points:

  • Use the app indexing extension point to index data in your app.
  • Use the Index Maintenance extension point to support the reindexing of app data without launching the app.

It's basically an extension to provide content for the Spotlight search in iOS.



回答2:

My understanding is individual app can expose a series of 'Activities' that contains keywords and can be indexed by OS. iOS would rank those activities based on usage on this device and other devices(which has this app installed) and expose the results when user starts typing keyword in OS spotlight. When clicking into that search results the OS would call the app's activities with certain key values so each app provides additional context(e.g: Jump to a specific song, open a certain document).