Unpredictable delay before UIPopoverController appears under iOS 8.1

前端 未结 3 1841
鱼传尺愫
鱼传尺愫 2021-02-05 11:56

This problem happens with SDK 8.1, when running under iOS 8.1, but not when running under iOS 7. It is for iPad only. The problem appears both with simulator and on a hardware d

3条回答
  •  有刺的猬
    2021-02-05 12:04

    I found that deselecting the row before attempting to show the popover seems to fix the problem. This may be a useful work-around, but I'm still looking for a better answer, since this may not be robust.

    -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {
        [tableView deselectRowAtIndexPath:indexPath animated:NO]; // adding this line appears to fix the problem
        [self showPopover:[tableView cellForRowAtIndexPath:indexPath]];
    }

    Note, as Yasir Ali commented, that for this workaround to work, deselect animation must be off. Almost 4 years after the original post, this behavior still affects iOS 12, and the bug report with Apple is still open - sigh.

提交回复
热议问题