I have a segue that takes just over a second to perform. The destination view controller is rather big, but even if I comment out the entire viewDidLoad
function, it still takes this much time. Can this happen from having too many properties and imports alone? (I have around 30 of each)
This is a trace of the events on a relative time frame:
00:00:00.000 Performing segue
00:00:01.297 View did load
00:00:01.315 View did appear
Things I have tried:
- Emptied
viewDidLoad
- Emptied
prepareForSegue
- Making sure the segue is being run in the main thread
- Emptied
viewWillAppear
(not that it should make a difference)
I am running this on an iPhone 6 Plus.
Edit:
The segue is being performed like this:
- (void)checkForPermissions
{
[self.permissionsUIGateway checkCameraPermissionSettingsFromViewController:self completionHandler:^(BOOL granted) {
if (granted)
{
dispatch_async(dispatch_get_main_queue(), ^{
[self performSegueWithIdentifier:@"goToCamera" sender:self];
});
}
}];
}
Edit 2:
I have found out that either using presentViewController:animated:completion
or changing the segue from Present modally to Show makes the delay completely disappear. This solves my problem, but I will leave the question open since I still have no idea why this solves it.