Custom Tabbarcontroller Push the next level controller will report such an error: Unbalanced calls to begin/end appearance transitions for < Uiviewcontroller>.
Some of the answers on the web are animated by animations,The workaround is to add a variable of type bool to check whether the animation is being made.
if (transiting) {
return;
}
transiting = YES;
[self TRANSITIONFROMVIEWCONTROLLER:_CURRENTVC toviewcontroller:newvc duration:0.5 options: Uiviewanimationoptiontransitioncrossdissolve animations:^{
} completion:^ (BOOL finished) {
transiting = NO;
}];
This will not appear the bug that you just said.
However, this does not 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];
}