我需要在 Tumblr 中与 iOS 中的应用程序 Tumblr 共享照片。
对于 Instagram,我喜欢这样:
NSData *imageData = UIImageJPEGRepresentation(self.test.image, 1.0);
NSString *writePath = [NSTemporaryDirectory() stringByAppendingPathComponent:@"instagram.igo"];
if (![imageData writeToFile:writePath atomically:YES]) {
NSLog(@"image save failed to path %@", writePath);
return;
}
// send it to instagram.
NSURL *fileURL = [NSURL fileURLWithPath:writePath];
self.documentController = [UIDocumentInteractionController interactionControllerWithURL:fileURL];
[self.documentController setUTI:@"com.instagram.exclusivegram"];
[self.documentController setAnnotation:@{@"InstagramCaption" : @"#hey"}];
if (![self.documentController presentOpenInMenuFromRect:self.view.frame inView:self.view animated:YES]) NSLog(@"couldn't present document interaction controller");
但是我找不到这样的方法,但是对于 Tumblr,谢谢