Custom TabBarController Push the next level Controller will report this error: Unbalanced calls to begin/end appearance transitions for <UIVIewController>.
The solution is to add a BOOL type variable to check if it is animating.
if (transiting) {
return;
}
transiting = YES;
[self transitionFromViewController:_currentVC toViewController:newVC duration:0.5 options:UIViewAnimationOptionTransitionCrossDissolve animations:^{
} completion:^(BOOL finished) {
transiting = NO;
}];
This way the bug just mentioned will not appear.
But that doesn’t solve my problem!
So the real answer is
After customizing the TabBarController, you must implement the following
-(void)viewWillAppear:(BOOL)animated
{
[self.selectedViewController beginAppearanceTransition: YES animated: animated];
}
-(void) viewDidAppear:(BOOL)animated
{
[self.selectedViewController endAppearanceTransition];
}
-(void) viewWillDisappear:(BOOL)animated
{
[self.selectedViewController beginAppearanceTransition: NO animated: animated];
}
-(void) viewDidDisappear:(BOOL)animated
{
[self.selectedViewController endAppearanceTransition];
}
Similar Posts:
- [Solved]Swift error: Method does not override any method from its superclass
- [Solved] Vue3 wow.js Error: Cannot set property ‘getPropertyValue’ of undefined
- .Net Core 5.0 Upload File sizes is limited via Swagger Api: error: request entity too large
- [Solved] Json.Net Error: Error getting value from ‘ScopeId’ on ‘System.Net.IPAddress’
- [Solved] Json.Net – Error getting value from ‘ScopeId’ on ‘System.Net.IPAddress’
- Mybatis where 1 = 1 and Tags
- [Solved] VUE Error: Component template should contain exactly one root element. If you are using v-if on mu…
- [Solved] Vue Error: Property or method “changeLoginType” is not defined on the instance but referenced during render
- An error occurs when SVN executes the clean up command