我正在尝试获取imageURL
ios 共享扩展用于在action sheet
.
我正在取回URL
罚款,但似乎无法弄清楚如何获得imageURL
.
这是我得到正常的方法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)
})
}
}
}
我试图将其更改typeIdentifier
为kUTTypeImage
无济于事。我有我的info.plist
设置来NSExtensionActivationRule
看看TRUEPREDICATE
我能检索到什么。我在想也许我必须在.plist
??
我的目标是 iOS 9.3