Posts

Showing posts from March, 2019

Core Spotlight , NSUserActivity with supports Call

Image
To add a NSUseActivity with a call contact feature , is quite useful to have a better user experience for your app. even when it's not active. In case you need to refer to some basic's please refer to my previous page . With this blog today we will see how to use , NSUserActivity a supportCall feature. For example in your app. you have ability to add local mechanic where you had performed  last service , next appointment so on and so forth. The code is quite simple and straight forward nothing much fancy here. func addLocalMechanicContactActivity(){ let localContact = NSUserActivity(activityType: "yourDomain.contact") localContact.title = "Local Mechanic Contact" localContact.userInfo = ["groupId":"20"] localContact.isEligibleForSearch = true localContact.becomeCurrent() localContact.contentAttributeSet = CSSearchableItemAttributeSet(itemContentType: kUTTypeContact as String)

Core Spotlight Framework - Adding NSUserActivity

Image
We use Spotlight search very often to do a quick search and expect a result with a quick swipe search, it includes search for favorite contacts, best restaurant , latest news , recent banking transaction, etc. Spotlight helps to enhance the user experience and improve discoverability of the content , finally land into your app. It supports from iOS 9 onwards, but not available for below devices: iPhone 4s iPad 2 iPad (3rd generation) iPad mini iPod touch (5th generation). CoreSpotlight framework provides API to have on device index , after which you can make it searchable publicly or private to your device , categories as " A private on-device index. " and " Apple’s server-side index.   " With this discussion will implement a private on-device index.  Will use NSUserActivity and Core Spotlight API's. A user performs many activities while using the app., for example in a Contact Activity the user is creating a favorite contact list. We wo