Instantly share code, notes, and snippets.

Embed
What would you like to do?
///
public static var bookRideActivity: NSUserActivity {
let activity = NSUserActivity(activityType: NSUserActivity.bookRideActivityType)
activity.title = NSLocalizedString("CS_TITLE", bundle: Bundle.ubifyBundle, comment: "View menu activity title")
activity.isEligibleForSearch = true
activity.isEligibleForPrediction = true
#if os(iOS)
let attributes = CSSearchableItemAttributeSet(itemContentType: "Solicitar un coche")
attributes.thumbnailData = UIImage(named: "shortcut")?.pngData() // Used as an icon in Search.
attributes.keywords = NSUserActivity.searchKeywords
attributes.displayName = NSLocalizedString("CS_TITLE", bundle: Bundle.ubifyBundle, comment: "View menu activity title")
let description = NSLocalizedString("CS_DESCRIPTION", bundle: Bundle.ubifyBundle, comment: "View menu content description")
attributes.contentDescription = description
activity.contentAttributeSet = attributes
#endif
let phrase = NSLocalizedString("ORDER_LUNCH_SUGGESTED_PHRASE", bundle: Bundle.ubifyBundle, comment: "")
activity.suggestedInvocationPhrase = phrase
return activity
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment