Skip to content

Commit

Permalink
fix: alert modal behaviour on iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
aanorbel committed Jun 6, 2024
1 parent 5577941 commit 5fc9f33
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
1 change: 0 additions & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 3df4eef5a3f5aeba6a6df642bb5d669cff0662b0


COCOAPODS: 1.15.2
8 changes: 8 additions & 0 deletions ooniprobe/View/Settings/SettingsTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,14 @@ -(IBAction)selectLanguage:(id)sender{
position:CSToastPositionBottom];
}]];
}

// Check if the device is an iPad
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
alert.popoverPresentationController.sourceView = self.view;
alert.popoverPresentationController.sourceRect = CGRectMake(self.view.bounds.size.width, self.view.bounds.size.height, 1.0, 1.0);
alert.popoverPresentationController.permittedArrowDirections = UIPopoverArrowDirectionUp;
}

[self presentViewController:alert animated:YES completion:nil];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ - (IBAction)showListActions:(id)sender {
[SettingsUtility updateAllWebsiteCategories:false];
[self.navigationController popViewControllerAnimated:YES];
}]];

// Check if the device is an iPad
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
alert.popoverPresentationController.sourceView = self.view;
alert.popoverPresentationController.sourceRect = CGRectMake(self.view.bounds.size.width / 2.0, self.view.bounds.size.height / 2.0, 1.0, 1.0);
}

[self presentViewController:alert animated:YES completion:nil];
}

Expand Down

0 comments on commit 5fc9f33

Please sign in to comment.