Created
August 5, 2015 14:07
-
-
Save pronebird/6318006f0d05e20fbdbd to your computer and use it in GitHub Desktop.
This file contains 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)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