2

This question has been asked before, but I haven't found an answer to my problem. All it is, is a simple table with cells that when clicked on push a view controller on the nav stack:

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{

    DetailViewController *dvc = [[DetailViewController alloc] init];

    [self.navigationController pushViewController:dvc animated:YES];

}

Done it many times with no issue, yet this time, it stops for a second midway and also has a weird grey color come and go. I have checked and there is no color set for the background and also the new VC doesn't have any code in it yet so loading too much code not an issue. I have looked and some people have had the same issue, one even posted a Gif of the problem:

UINavigationController pushViewController pauses/freezes midway through

Is this an Apple bug?

Thanks

Community
  • 1
  • 1
Paul
  • 1,277
  • 5
  • 28
  • 56
  • I see exactly the same thing when transitioning from a view controller that is a UITableViewController. So I think it _is_ an Apple bug. (In any case, please make a simple example project and file a bug report with Apple.) – matt Aug 29 '16 at 18:57

2 Answers2

7

As the link you posted suggests, is there the background of your DetailViewController set to clear colour? Set the background colour of DetailViewController to black or some colour and you won't see this 'pause' midway. Yeah it looks like some funny behavior when a clear colour background is used. Hope this helps, good luck.

JingJingTao
  • 1,760
  • 17
  • 28
  • Hi, thanks for your input, unfortunately, the background colour doesn't fix the problem. I've tried setting to white, black etc... still choppy. – Paul Aug 30 '16 at 12:40
  • Okay, would you be able to post a gif of the animation or is the same as what is posted in the link? Are you able to post a sample project on github? – JingJingTao Aug 30 '16 at 13:22
  • I can post it if you want, it's exactly the same as the gif though. Same grey colour same timing etc... I will post sample project on github later – Paul Aug 31 '16 at 10:50
  • Cool, yeah no need to post a gif if it's the same. Awesome, if you post a sample on github I can take a look. – JingJingTao Aug 31 '16 at 11:01
5

What helped me is just directly set background color of new controller to white or whatever you need. This will force your new controller to hide this behavior as you mentioned .

Swiift 4.2

Andrey
  • 51
  • 1
  • 2