I'm presenting an ActionSheet with UIAlertController
when a tableView cell is selected.
My code is like this:
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Select Action"
message:nil
preferredStyle:UIAlertControllerStyleActionSheet];
[alert addAction:[UIAlertAction actionWithTitle:@"Action 1"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * _Nonnull action)
{
[self handleAction1Selected];
}]];
[alert addAction:[UIAlertAction actionWithTitle:@"Action 2"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * _Nonnull action)
{
[self handleAction2Selected];
}]];
[alert addAction:[UIAlertAction actionWithTitle:@"Action 3"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * _Nonnull action)
{
[self handleAction3Selected];
}]];
[alert addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil]];
[self presentViewController:alert animated:YES completion:nil];
This code is called in [tableView:didSelectRowAtIndexPath:]
method,
however, there is always huge lag after I select a tableview cell until the ActionSheet actually pops up.
The lag ranges between 1 second to 10, sometimes even 20 seconds.
This is pretty simple code without much configuration, is there anything I'm doing wrong or it's just a bug for Apple?