Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private func donate() {
- let orderActivity = NSUserActivity(activityType: "com.azamsharp.HotCoffee.activity-type")
- orderActivity.isEligibleForSearch = true
- orderActivity.isEligibleForPrediction = true
- orderActivity.title = "Regular Hot Coffee"
- orderActivity.suggestedInvocationPhrase = "Coffee Time"
- let attributes = CSSearchableItemAttributeSet(itemContentType: kUTTypeItem as String)
- attributes.contentDescription = "Get it while its hot!"
- if let thumbnailImage = UIImage(named: "coffee-thumbnail-image") {
- attributes.thumbnailData = thumbnailImage.pngData()
- }
- orderActivity.contentAttributeSet = attributes
- self.userActivity = orderActivity
- self.userActivity?.becomeCurrent()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement