Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Method presents a modal view controller and uses non deprecated method in iOS 6
- */
- - (void)presentCameraViewController:(UIViewController*)cameraViewController isModal:(BOOL)isModal {
- if (isModal) {
- cameraViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
- cameraViewController.modalPresentationStyle = UIModalPresentationFullScreen;
- if ([self respondsToSelector:@selector(presentViewController:animated:completion:)]) {
- [self presentViewController:cameraViewController animated:YES completion:nil];
- } else {
- [self presentModalViewController:cameraViewController animated:YES];
- }
- } else {
- [[self navigationController] pushViewController:cameraViewController animated:YES];
- }
- }
- /**
- * Method dismisses a modal view controller and uses non deprecated method in iOS 6
- */
- - (void)dismissCameraViewControllerModal:(BOOL)isModal {
- if (isModal) {
- if ([self respondsToSelector:@selector(dismissViewControllerAnimated:completion:)]) {
- [self dismissViewControllerAnimated:YES completion:nil];
- } else {
- [self dismissModalViewControllerAnimated:YES];
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement