How do I get the image from a NSItemProvider file? When I use -loadItemForTypeIdentifier:kUTTypeImage , I get a NSURL that looks like this
file:///var/mobile/Media/DCIM/103APPLE/IMG_3349.JPG
what can I do with it? Thanks!
TAGS: NSItemProvider NSExtensionItem ios share extensions
simply use
[imageItemProvider loadItemForTypeIdentifier:(NSString *)kUTTypeImage options:nil completionHandler:^(id item, NSError *error) {
if (item)
{
NSData *data = [NSData dataWithContentsOfURL:item];
}
do whatever you want with data
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With