Skip to content
This repository has been archived by the owner on Aug 7, 2021. It is now read-only.

Commit

Permalink
Presents a stop controller action sheet from a popover on iPad
Browse files Browse the repository at this point in the history
Fixes #1177 - “...” button when viewing a Stop crashes on iPad
  • Loading branch information
aaronbrethorst committed Sep 19, 2017
1 parent fa1230d commit 80293db
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions OneBusAway/ui/stops/OBAStopViewController.m
Expand Up @@ -486,7 +486,7 @@ - (void)showFilterAndSortUI {
[self presentViewController:nav animated:YES completion:nil];
}

- (void)showActionsMenu {
- (void)showActionsMenu:(id)sender {
OBAStopV2 *stop = self.arrivalsAndDepartures.stop;

UIAlertController *actionSheet = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
Expand Down Expand Up @@ -535,14 +535,14 @@ - (void)showActionsMenu {
// Cancel
[actionSheet addAction:[UIAlertAction actionWithTitle:OBAStrings.cancel style:UIAlertActionStyleCancel handler:nil]];

[self presentViewController:actionSheet animated:YES completion:nil];
[self oba_presentViewController:actionSheet fromView:sender];
}

- (void)createTableHeaderView {
self.stopHeaderView = [[OBAStopTableHeaderView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.tableView.frame), kTableHeaderHeight)];
self.stopHeaderView.highContrastMode = [OBATheme useHighContrastUI];

[self.stopHeaderView.menuButton addTarget:self action:@selector(showActionsMenu) forControlEvents:UIControlEventTouchUpInside];
[self.stopHeaderView.menuButton addTarget:self action:@selector(showActionsMenu:) forControlEvents:UIControlEventTouchUpInside];
[self.stopHeaderView.filterButton addTarget:self action:@selector(showFilterAndSortUI) forControlEvents:UIControlEventTouchUpInside];

self.tableView.tableHeaderView = self.stopHeaderView;
Expand Down

0 comments on commit 80293db

Please sign in to comment.