Remove deprecated symbols for iOS < 6

This commit is contained in:
Andrew Grieve 2014-06-04 14:22:41 -04:00
parent 4c901d56be
commit 7b60a0b6d1

View File

@ -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) {