cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject git commit: Remove deprecated symbols for iOS < 6
Date Wed, 04 Jun 2014 18:25:58 GMT
Repository: cordova-plugin-media-capture
Updated Branches:
  refs/heads/master d99eb73fe -> be274d785


Remove deprecated symbols for iOS < 6


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/commit/be274d78
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/tree/be274d78
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/diff/be274d78

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

----------------------------------------------------------------------
 src/ios/CDVCapture.m | 42 ++++++------------------------------------
 1 file changed, 6 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/blob/be274d78/src/ios/CDVCapture.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVCapture.m b/src/ios/CDVCapture.m
index 6bcf0ad..060b935 100644
--- a/src/ios/CDVCapture.m
+++ b/src/ios/CDVCapture.m
@@ -106,13 +106,7 @@
 
         self.inUse = YES;
 
-        SEL selector = NSSelectorFromString(@"presentViewController:animated:completion:");
-        if ([self.viewController respondsToSelector:selector]) {
-            [self.viewController presentViewController:navController animated:YES completion:nil];
-        } else {
-            // deprecated as of iOS >= 6.0
-            [self.viewController presentModalViewController:navController animated:YES];
-        }
+        [self.viewController presentViewController:navController animated:YES completion:nil];
     }
 
     if (result) {
@@ -159,13 +153,7 @@
         // CDVImagePicker specific property
         pickerController.callbackId = callbackId;
 
-        SEL selector = NSSelectorFromString(@"presentViewController:animated:completion:");
-        if ([self.viewController respondsToSelector:selector]) {
-            [self.viewController presentViewController:pickerController animated:YES completion:nil];
-        } else {
-            // deprecated as of iOS >= 6.0
-            [self.viewController presentModalViewController:pickerController animated:YES];
-        }
+        [self.viewController presentViewController:pickerController animated:YES completion:nil];
     }
 }
 
@@ -277,13 +265,7 @@
         // CDVImagePicker specific property
         pickerController.callbackId = callbackId;
 
-        SEL selector = NSSelectorFromString(@"presentViewController:animated:completion:");
-        if ([self.viewController respondsToSelector:selector]) {
-            [self.viewController presentViewController:pickerController animated:YES completion:nil];
-        } else {
-            // deprecated as of iOS >= 6.0
-            [self.viewController presentModalViewController:pickerController animated:YES];
-        }
+        [self.viewController presentViewController:pickerController animated:YES completion:nil];
     }
 }
 
@@ -505,11 +487,7 @@
     CDVImagePicker* cameraPicker = (CDVImagePicker*)picker;
     NSString* callbackId = cameraPicker.callbackId;
 
-    if ([picker respondsToSelector:@selector(presentingViewController)]) {
-        [[picker presentingViewController] dismissModalViewControllerAnimated:YES];
-    } else {
-        [[picker parentViewController] dismissModalViewControllerAnimated:YES];
-    }
+    [[picker presentingViewController] dismissViewControllerAnimated:YES completion:nil];
 
     CDVPluginResult* result = nil;
 
@@ -546,11 +524,7 @@
     CDVImagePicker* cameraPicker = (CDVImagePicker*)picker;
     NSString* callbackId = cameraPicker.callbackId;
 
-    if ([picker respondsToSelector:@selector(presentingViewController)]) {
-        [[picker presentingViewController] dismissModalViewControllerAnimated:YES];
-    } else {
-        [[picker parentViewController] dismissModalViewControllerAnimated:YES];
-    }
+    [[picker presentingViewController] dismissViewControllerAnimated:YES completion:nil];
 
     CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageToErrorObject:CAPTURE_NO_MEDIA_FILES];
     [self.commandDelegate sendPluginResult:result callbackId:callbackId];
@@ -847,11 +821,7 @@
 - (void)dismissAudioView:(id)sender
 {
     // called when done button pressed or when error condition to do cleanup and remove view
-    if ([self.captureCommand.viewController.modalViewController respondsToSelector:@selector(presentingViewController)])
{
-        [[self.captureCommand.viewController.modalViewController presentingViewController]
dismissModalViewControllerAnimated:YES];
-    } else {
-        [[self.captureCommand.viewController.modalViewController parentViewController] dismissModalViewControllerAnimated:YES];
-    }
+    [[self.captureCommand.viewController.presentedViewController presentingViewController]
dismissViewControllerAnimated:YES completion:nil];
 
     if (!self.pluginResult) {
         // return error


Mime
View raw message