Advertisement
Guest User

Untitled

a guest
Aug 30th, 2014
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. /**
  2. * Method presents a modal view controller and uses non deprecated method in iOS 6
  3. */
  4. - (void)presentCameraViewController:(UIViewController*)cameraViewController isModal:(BOOL)isModal {
  5. if (isModal) {
  6. cameraViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
  7. cameraViewController.modalPresentationStyle = UIModalPresentationFullScreen;
  8.  
  9. if ([self respondsToSelector:@selector(presentViewController:animated:completion:)]) {
  10. [self presentViewController:cameraViewController animated:YES completion:nil];
  11. } else {
  12. [self presentModalViewController:cameraViewController animated:YES];
  13. }
  14. } else {
  15. [[self navigationController] pushViewController:cameraViewController animated:YES];
  16. }
  17. }
  18.  
  19. /**
  20. * Method dismisses a modal view controller and uses non deprecated method in iOS 6
  21. */
  22. - (void)dismissCameraViewControllerModal:(BOOL)isModal {
  23. if (isModal) {
  24. if ([self respondsToSelector:@selector(dismissViewControllerAnimated:completion:)]) {
  25. [self dismissViewControllerAnimated:YES completion:nil];
  26. } else {
  27. [self dismissModalViewControllerAnimated:YES];
  28. }
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement