-
-
Save fitomad/4668143f1172fbb8865912ff9820255d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// | |
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