uidocumentinteraction

Swift: UIDocumentInteractionController is not working?

两盒软妹~` 提交于 2019-12-11 00:43:45
问题 UIDocumentInteractionController is not working with large pdf files with multiple pages. Here in my code, var docController:UIDocumentInteractionController! ... DispatchQueue.main.async (execute: { [weak self] in self?.docController = UIDocumentInteractionController(url: pdfFileURL!) self?.docController.delegate = self self?.docController.name = pdfFileURL?.lastPathComponent self?.docController.presentPreview(animated: true) }) and delegate method, func

UIDocumentInteractionController not working

吃可爱长大的小学妹 提交于 2019-12-10 22:49:56
问题 In my application I want to download various types of files and exports so that the user can open the file with the application that opens this type of file. I'm trying to use the UIDocumentInteractionController but after downloading save it to my device and trying to open it several problems happen. With .docx the application breaks and with other files it does not appear to encode the file. What can I be doing wrong? When I try to share the file through the airdrop I get an error that says

iPhone/Objective-C - UIDocumentInteractionController Class Reference when presenting a view and delegates

匆匆过客 提交于 2019-12-10 19:14:17
问题 I am using UIDocumentInteractionController inside my application in order to present the Instagram filter screen as described here from within my application: http://instagram.com/developer/iphone-hooks/ UIDocumentInteractionController Class Reference documentation: I'm not quite sure whether it's possible to dismiss the Instagram filter screen and return back to my application with the modified UIImage after it has been uploaded (or maybe after it's been filtered) by Instagram. As far as I

UIDocumentInteractionController Opening file in a specific app without options

北慕城南 提交于 2019-12-10 13:33:23
问题 I'm using UIDocumentInteractionController to open a file in another app, DropBox. What i'm trying to do is open the file in another specific app , but i only managed so far to display the supported apps and allowing the user to choose. UIDocumentInteractionController *udi = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath: jpgPath]]; [udi retain]; CGRect r = CGRectMake(0, 0, 300, 300); [udi presentOpenInMenuFromRect:r inView:self.view animated:YES]; This

UIDocumentInteractionController stopped working iOS 8

南笙酒味 提交于 2019-12-09 13:03:21
问题 I have a PDF file saved in the document directory. The path to the file is stored in a NSString property 'self.URL'. Here is my code to present the activity items: -(void)presentDocumentInteractionController{ self.docController = [UIDocumentInteractionController interactionControllerWithURL:self.URL]; self.docController.delegate = self; [_docController setUTI:@"com.adobe.pdf"]; [_docController presentOptionsMenuFromBarButtonItem:self.activityBarButton animated:YES]; } Before iOS 8 this code

UIDocumentInteractionController displaying blank pdf

こ雲淡風輕ζ 提交于 2019-12-09 05:49:49
问题 I'm trying to display a pdf on iOS devices using the UIDocumentInteractionController presentPreviewAnimated method, but it keeps displaying a blank document. I think it might have to do with the character encoding, but I'm not sure. If I use a UIWebView, I can get the pdf to display, just not with the document interaction controller. // UPDATE 9/18/14 This is now working with the GM release of Xcode 6. // UPDATE 8/22/14 Oddly enough, from the DocumentInteractionController, if I tap on the

UIDocumentInteractionController prevent Airdrop in the 'Open in' sheet

社会主义新天地 提交于 2019-12-08 16:09:53
问题 In my app, I'm allowing users to share photos via Instagram, which requires the use of UIDocumentInteractionController. Airdrop is automatically detected if the phone supports it. How do I remove it from this ‘Open in’ action sheet? Even if I begin the sharing process with a UIActivityViewController and call setExcludedActivityTypes:, eventually I must use a UIDocumentInteractionController, and when I do, Airdrop appears again. Here is the code when the share button gets tapped: NSURL

Whatsapp Image sharing not working

六月ゝ 毕业季﹏ 提交于 2019-12-08 03:49:40
问题 My class implements the UIDocumentInteractionControllerDelegate and I have the following property: @property (nonatomic,retain) UIDocumentInteractionController * documentInteractionController; if ([[UIApplication sharedApplication] canOpenURL: [NSURL URLWithString:@"whatsapp://app"]]) { UIImage *iconImage = [UIImage imageNamed:@"bg_iPhone_5.jpg"]; NSString *savePath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/whatsAppTmp.wai"]; [UIImageJPEGRepresentation(iconImage, 1.0)

UIDocumentsInteractionController shows iBooks but doesn't open it

给你一囗甜甜゛ 提交于 2019-12-07 10:27:46
问题 My UIDocumentsInteractionController is working as far as presenting an action sheet with a button that says "iBooks" but when I click on that button, it just dismisses and it doesn't take me to iBooks. Here's my code: NSString *filenamePath =[NSString stringWithFormat:@"temp.%@", [[file path] pathExtension]]; NSString *docDir = [DataCenter getDocumentsDirectoryPath]; NSString *fullPath = [docDir stringByAppendingPathComponent:filenamePath]; NSURL *url = [NSURL fileURLWithPath:fullPath];

UIDocumentInteractionController opening pdf in iBooks crashes

爱⌒轻易说出口 提交于 2019-12-07 07:47:28
I have a test PDF file that I want to open in iBooks through my app. I saved it in my temp directory and I use this code to load it to iBooks: NSURL *targetURL = [NSURL fileURLWithPath:tempFullPath]; NSLog(@"Path is %@", tempFullPath); UIDocumentInteractionController *controller = [UIDocumentInteractionController interactionControllerWithURL:targetURL]; controller.delegate = self; controller.UTI = @"com.adobe.pdf"; [controller presentOpenInMenuFromRect:self.view.bounds inView:self.view animated:YES]; The menu pops up just fine but when I tap the iBooks button the app crashes and hangs my Xcode