Last active
April 21, 2023 06:56
-
-
Save nonamelive/9334458 to your computer and use it in GitHub Desktop.
Prevent UINavigationController from pushing two view controllers at the same time in case of stack inconsistency and crashes
We had the same issue as @whychengxiaogang said, it will not enter push flow if swipe from edge to right for poping view controller but not actually pop, just be in middle state of pushing.
our workaournd: in view controller :
-
(void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
staticMember.shouldIgnorePushingViewControllers = YES;
} -
(void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:NO];
staticMember.shouldIgnorePushingViewControllers = NO;
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there a way to reproduce the crash that this code tries to solve?
I like @heikkihautala 's idea and I'm trying to implement it. But I have to make sure that my code solves the crash too.