File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -234,7 +234,12 @@ - (void)imagePickerController:(UIImagePickerController *)picker didFinishPicking
234
234
235
235
- (void )imagePickerControllerDidCancel : (UIImagePickerController *)picker
236
236
{
237
- [picker dismissModalViewControllerAnimated: YES ];
237
+ // Workaround for iOS 4 compatibility http://stackoverflow.com/questions/12445190/dismissmodalviewcontrolleranimated-deprecated
238
+ if ([self respondsToSelector: @selector (dismissViewControllerAnimated:completion: )])
239
+ [picker dismissViewControllerAnimated: YES completion: nil ];
240
+ else
241
+ [picker dismissModalViewControllerAnimated: YES ];
242
+
238
243
if ([self .delegate respondsToSelector: @selector (takeController:didCancelAfterAttempting: )])
239
244
[self .delegate takeController: self didCancelAfterAttempting: YES ];
240
245
}
You can’t perform that action at this time.
0 commit comments