Skip to content

Commit

Permalink
Fixing issues on iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
sarriaroman committed Oct 15, 2015
1 parent f06aad3 commit 57a3a74
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/ios/PhotoViewer.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ - (void)setupDocumentControllerWithURL:(NSURL *)url andTitle:(NSString *)title
self.docInteractionController.name = title;
self.docInteractionController.delegate = self;
} else {
self.docInteractionController.name = title;
self.docInteractionController.URL = url;
}
}
Expand Down Expand Up @@ -80,11 +81,15 @@ - (NSURL *)localFileURLForImage:(NSString *)image

NSData *data = [NSData dataWithContentsOfURL:fileURL];

fileURL = [[tmpDirURL URLByAppendingPathComponent:filename] URLByAppendingPathExtension:[self contentTypeForImageData:data]];
if( data ) {
fileURL = [[tmpDirURL URLByAppendingPathComponent:filename] URLByAppendingPathExtension:[self contentTypeForImageData:data]];

[[NSFileManager defaultManager] createFileAtPath:[fileURL path] contents:data attributes:nil];
[[NSFileManager defaultManager] createFileAtPath:[fileURL path] contents:data attributes:nil];

return fileURL;
return fileURL;
} else {
return nil;
}
}

- (NSString *)contentTypeForImageData:(NSData *)data {
Expand Down

0 comments on commit 57a3a74

Please # to comment.