NetCod
NetCod

Reputation: 191

ios extension and obtaining url title and page screenshot

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

enter image description here

Upvotes: 0

Views: 430

Answers (1)

NetCod
NetCod

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

Related Questions