mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-17 15:09:31 +02:00
Make the plus button not crash on iPad
This commit is contained in:
@@ -37,6 +37,7 @@ typedef void (^blockCustomAlert_onClick)(CustomAlert *alert);
|
||||
typedef void (^blockCustomAlert_textFieldHandler)(UITextField *textField);
|
||||
|
||||
@property(nonatomic) NSInteger cancelButtonIndex; // required to dismiss cusmtomAlert on iOS < 8 (default is -1).
|
||||
@property(nonatomic, weak) UIView *sourceView;
|
||||
|
||||
- (id)initWithTitle:(NSString *)title message:(NSString *)message style:(CustomAlertStyle)style;
|
||||
// adds a button with the title. returns the index (0 based) of where it was added.
|
||||
|
||||
@@ -133,6 +133,10 @@
|
||||
if ([alert isKindOfClass:[UIAlertController class]]) {
|
||||
if (viewController) {
|
||||
parentViewController = viewController;
|
||||
if (self.sourceView) {
|
||||
[alert popoverPresentationController].sourceView = self.sourceView;
|
||||
[alert popoverPresentationController].sourceRect = self.sourceView.bounds;
|
||||
}
|
||||
[viewController presentViewController:(UIAlertController *)alert animated:YES completion:nil];
|
||||
}
|
||||
} else if ([alert isKindOfClass:[UIActionSheet class]]) {
|
||||
|
||||
@@ -953,6 +953,7 @@ NSString *const kFailedEventId = @"failedEventId";
|
||||
self.actionMenu.cancelButtonIndex = [self.actionMenu addActionWithTitle:@"Cancel" style:CustomAlertActionStyleDefault handler:^(CustomAlert *alert) {
|
||||
weakSelf.actionMenu = nil;
|
||||
}];
|
||||
weakSelf.actionMenu.sourceView = weakSelf.optionBtn;
|
||||
[self.actionMenu showInViewController:self];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user