-
-
Save jjthrash/7450703 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+- (void)downloadDocumentAtURL:(NSURL*)url { | |
+ @autoreleasepool { | |
+ NSData *data = [NSData dataWithContentsOfURL:url]; | |
+ NSString *filename = [[[NSUUID UUID] UUIDString] stringByAppendingPathExtension:@"pdf"]; | |
+ NSString *fullPath = [NSTemporaryDirectory() stringByAppendingPathComponent:filename]; | |
+ | |
+ [data writeToFile:fullPath atomically:NO]; | |
+ | |
+ ReaderDocument *document = [ReaderDocument withDocumentFilePath:fullPath password:nil]; | |
+ [self performSelectorOnMainThread:@selector(displayDocument:) withObject:document waitUntilDon | |
+ } | |
+} | |
+ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment