From 564bd5904d65154769c4f79f9eb850953ed3cef4 Mon Sep 17 00:00:00 2001 From: sungjin-woo Date: Tue, 22 Nov 2016 14:28:38 +0900 Subject: [PATCH] Fix iPad crash issue when popoverPresentationControllerBlock of actionsheet is NULL If the popoverPresentationControllerBlock of actionsheet is NULL on using the actionsheet, the actionsheet will be shown in Center of the parent view controller. --- RMUniversalAlert.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/RMUniversalAlert.m b/RMUniversalAlert.m index 1b7e998..bd9f173 100644 --- a/RMUniversalAlert.m +++ b/RMUniversalAlert.m @@ -126,6 +126,11 @@ + (instancetype)showActionSheetInViewController:(UIViewController *)viewControll popover.sourceView = configuredPopover.sourceView; popover.sourceRect = configuredPopover.sourceRect; popover.barButtonItem = configuredPopover.barButtonItem; + } else { + popover.sourceView = viewController.view; + popover.sourceRect = viewController.view.bounds; + + popover.permittedArrowDirections = (UIPopoverArrowDirection) 0; } } tapBlock:^(UIAlertController *controller, UIAlertAction *action, NSInteger buttonIndex){