Reputation: 191
I am working on an extension for my image sharing app. I want to access the title of the Safari page here - "Designed Denim sale...." and the attachment as a screenshot so I can then use them to launch my app in iOS 10. I can access the url for now but am not sure how I can get the title and the screenshot/attachment seen in this UI. Thanks
Upvotes: 0
Views: 430
Reputation: 191
// get url title
let itemTitle = self.extensionContext?.inputItems[0].attributedContentText!
print ("Text is \(itemTitle?.string) end of text")
self.defaults?.setObject(itemTitle?.string, forKey: "itemName")
Above code does the job.
Upvotes: 1