Skip to content

Instantly share code, notes, and snippets.

@pronebird
Created August 5, 2015 14:07
Show Gist options
  • Save pronebird/6318006f0d05e20fbdbd to your computer and use it in GitHub Desktop.
Save pronebird/6318006f0d05e20fbdbd to your computer and use it in GitHub Desktop.
- (void)documentPicker:(UIDocumentPickerViewController *)controller didPickDocumentAtURL:(NSURL *)url {
UIImage *receipt = [UIImage imageWithContentsOfFile:url.path];
// BUG: http://www.openradar.me/20447945
// Skip one run loop to hook up transition coordinator and run action when picker dismissed
dispatch_async(dispatch_get_main_queue(), ^{
// iOS < 8.3
if(controller.transitionCoordinator) {
[controller.transitionCoordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context) {
} completion:^(id<UIViewControllerTransitionCoordinatorContext> context) {
[self _presentSaveReceiptController:receipt];
}];
}
else { // > iOS 8.3+
[self _presentSaveReceiptController:receipt];
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment