Properly configure action sheets for iPads

This commit is contained in:
shiftcmdk 2019-08-02 11:36:47 +02:00
parent 1ce677a1ce
commit 20c2f91b3c
4 changed files with 15 additions and 0 deletions

View File

@ -243,6 +243,9 @@ extern "C" CFNotificationCenterRef CFNotificationCenterGetDistributedCenter(void
[alert addAction:saveAction];
[alert addAction:saveAndRunAction];
[alert addAction:cancelAction];
alert.popoverPresentationController.sourceView = self.doneButton;
alert.popoverPresentationController.sourceRect = self.doneButton.bounds;
[self presentViewController:alert animated:YES completion:nil];
}

View File

@ -116,6 +116,8 @@ extern "C" CFNotificationCenterRef CFNotificationCenterGetDistributedCenter(void
[deleteAlert addAction:deleteAction];
[deleteAlert addAction:cancelAction];
deleteAlert.popoverPresentationController.barButtonItem = sender;
[self presentViewController:deleteAlert animated:YES completion:nil];
}

View File

@ -139,6 +139,11 @@ extern "C" CFNotificationCenterRef CFNotificationCenterGetDistributedCenter(void
[deleteAlert addAction:deleteAction];
[deleteAlert addAction:cancelAction];
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
deleteAlert.popoverPresentationController.sourceView = cell;
deleteAlert.popoverPresentationController.sourceRect = cell.bounds;
[self presentViewController:deleteAlert animated:YES completion:nil];
}
}

View File

@ -259,6 +259,11 @@ extern "C" CFNotificationCenterRef CFNotificationCenterGetDistributedCenter(void
[deleteAlert addAction:deleteAction];
[deleteAlert addAction:cancelAction];
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
deleteAlert.popoverPresentationController.sourceView = cell;
deleteAlert.popoverPresentationController.sourceRect = cell.bounds;
[self presentViewController:deleteAlert animated:YES completion:nil];
}