Reputation: 2352
Sometimes when I use: [self presentViewController:viewController animated:YES completion:nil];
or even if a modal segue handles the transition, it just pops up without any transition, making it look ugly. Whilst rare, when this does happen, every single modal VC does the same regardless of where/how it's called. When I restart the app the issue goes and that's it, it won't happen again for some time. Something which is odd though, there is a transition when dismissing the VC. Is this a bug?
Thanks for the help,
Regards,
Mike
Update: I think I've found the cause. This bug effects most modal VC's and all Segue modal VC's when ever I present my tutorial view like this:
[tableView deselectRowAtIndexPath:indexPath animated:NO];
TutorialViewController *tutPopUp = [[TutorialViewController alloc] init];
self.tabBarController.modalPresentationStyle = UIModalPresentationCurrentContext;
[self presentModalViewController:tutPopUp animated:NO];
I think the issue is with self.tabBarController.modalPresentationStyle = UIModalPresentationCurrentContext;
which effects the entire tab bar. What is the default value so I can set is back once I've loaded this particular VC?
Answered: After doing some reading of the Apple Docs I discovered that the default modalPresentationStyle
is UIModalPresentationFullScreen
so setting it to thus after using another presentationStyle, fixed it.
Upvotes: 0
Views: 540
Reputation: 2352
The Issue lies here in some code which I used to display another VC elsewhere in my app:
[tableView deselectRowAtIndexPath:indexPath animated:NO];
TutorialViewController *tutPopUp = [[TutorialViewController alloc] init];
self.tabBarController.modalPresentationStyle = UIModalPresentationCurrentContext;
[self presentModalViewController:tutPopUp animated:NO];
The issue is specifically here: self.tabBarController.modalPresentationStyle = UIModalPresentationCurrentContext;
because this effects the entire tab bar in my app and changes the presentation style to one with no animation. I discovered that the default modalPresentationStyle
is UIModalPresentationFullScreen
so setting it to thus after using another presentationStyle, fixed my issue.
Upvotes: 1
Reputation: 9035
If you are experiencing this on device I would imagine that there is some intensive CPU task being performed which is causing blocking and stuttering on the main thread. If it's on simulator your Mac might just be overburdened at that moment.
One thing you say makes me wonder about your memory management. You say that if you quit the app the issue goes away for awhile. Makes me think you have a memory leak which is affecting performance. Are you using ARC?
Because you're explicitly calling for animation there's no reason why it would display without it on a UIKit level.
Upvotes: 1