Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Choppy transition when pushing View Controller

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

like image 748
Paul Avatar asked Jun 07 '26 05:06

Paul


2 Answers

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.

like image 171
JingJingTao Avatar answered Jun 10 '26 18:06

JingJingTao


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

like image 24
Andrey Avatar answered Jun 10 '26 18:06

Andrey