You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2014/06/04 20:25:38 UTC

git commit: Remove deprecated symbols for iOS < 6

Repository: cordova-plugin-camera
Updated Branches:
  refs/heads/master 4c901d56b -> 7b60a0b6d


Remove deprecated symbols for iOS < 6


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/commit/7b60a0b6
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/tree/7b60a0b6
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/diff/7b60a0b6

Branch: refs/heads/master
Commit: 7b60a0b6d1ffc5171e49b5b9eaa4070149f1ab1a
Parents: 4c901d5
Author: Andrew Grieve <ag...@chromium.org>
Authored: Wed Jun 4 14:22:41 2014 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Wed Jun 4 14:22:41 2014 -0400

----------------------------------------------------------------------
 src/ios/CDVCamera.m | 21 +++------------------
 1 file changed, 3 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-camera/blob/7b60a0b6/src/ios/CDVCamera.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVCamera.m b/src/ios/CDVCamera.m
index 8c11e60..ab99297 100644
--- a/src/ios/CDVCamera.m
+++ b/src/ios/CDVCamera.m
@@ -151,13 +151,7 @@ static NSSet* org_apache_cordova_validArrowDirections;
         NSDictionary* options = [command.arguments objectAtIndex:10 withDefault:nil];
         [self displayPopover:options];
     } else {
-        SEL selector = NSSelectorFromString(@"presentViewController:animated:completion:");
-        if ([self.viewController respondsToSelector:selector]) {
-            [self.viewController presentViewController:cameraPicker animated:YES completion:nil];
-        } else {
-            // deprecated as of iOS >= 6.0
-            [self.viewController presentModalViewController:cameraPicker animated:YES];
-        }
+        [self.viewController presentViewController:cameraPicker animated:YES completion:nil];
     }
     self.hasPendingOperation = YES;
 }
@@ -266,11 +260,7 @@ static NSSet* org_apache_cordova_validArrowDirections;
         cameraPicker.popoverController.delegate = nil;
         cameraPicker.popoverController = nil;
     } else {
-        if ([cameraPicker respondsToSelector:@selector(presentingViewController)]) {
-            [[cameraPicker presentingViewController] dismissModalViewControllerAnimated:YES];
-        } else {
-            [[cameraPicker parentViewController] dismissModalViewControllerAnimated:YES];
-        }
+        [[cameraPicker presentingViewController] dismissViewControllerAnimated:YES completion:nil];
     }
 
     CDVPluginResult* result = nil;
@@ -386,12 +376,7 @@ static NSSet* org_apache_cordova_validArrowDirections;
 {
     CDVCameraPicker* cameraPicker = (CDVCameraPicker*)picker;
 
-    if ([cameraPicker respondsToSelector:@selector(presentingViewController)]) {
-        [[cameraPicker presentingViewController] dismissModalViewControllerAnimated:YES];
-    } else {
-        [[cameraPicker parentViewController] dismissModalViewControllerAnimated:YES];
-    }
-    // popoverControllerDidDismissPopover:(id)popoverController is called if popover is cancelled
+    [[cameraPicker presentingViewController] dismissViewControllerAnimated:YES completion:nil];
 
     CDVPluginResult* result;
     if ([ALAssetsLibrary authorizationStatus] == ALAuthorizationStatusAuthorized) {