I am trying to get the imageURL
ios sharing extension for a thumbnail generated in action sheet
.
I URL
get a fine, but I can’t figure out how to get it imageURL
.
This is how I get normal URL
,
if let item = extensionContext?.inputItems.first as? NSExtensionItem {
if let itemProvider = item.attachments?.first as? NSItemProvider {
if itemProvider.hasItemConformingToTypeIdentifier(kUTTypeItem as String) {
itemProvider.loadItem(forTypeIdentifier: kUTTypeItem as String, options: nil, completionHandler: { (url, error) -> Void in
if let shareURL = url as? NSURL {
let components = URLComponents(url:shareURL as URL, resolvingAgainstBaseURL: true)
if let host = components?.host { self.shareTitle = host }
self.shareURL = shareURL.absoluteString!
self.POSTShareData(completion: nil)
}
self.extensionContext?.completeRequest(returningItems: [], completionHandler:nil)
})
}
}
}
I tried to change typeIdentifier
to kUTTypeImage
no avail. I have it installed info.plist
NSExtensionActivationRule
on TRUEPREDICATE
to find out what I can get. I think maybe I should be more explicit in .plist
??
I am targeting iOS 9.3
Ro4ch source
share