diff --git a/LNPopupController/LNPopupController/Private/LNPopupController.m b/LNPopupController/LNPopupController/Private/LNPopupController.m index df5dd94..867641d 100644 --- a/LNPopupController/LNPopupController/Private/LNPopupController.m +++ b/LNPopupController/LNPopupController/Private/LNPopupController.m @@ -558,8 +558,9 @@ - (void)_transitionToState:(LNPopupPresentationState)state notifyDelegate:(BOOL) if(animated == NO) { - [_runningPopupAnimation stopAnimation:NO]; - [_runningPopupAnimation finishAnimationAtPosition:UIViewAnimatingPositionEnd]; + UIViewPropertyAnimator* retained = _runningPopupAnimation; + [retained stopAnimation:NO]; + [retained finishAnimationAtPosition:UIViewAnimatingPositionEnd]; } } @@ -1259,15 +1260,17 @@ - (void)_addEventQueueResumptionStep:(UIViewPropertyAnimator*)animator //{ // if(_runningBarAnimation != nil) // { -// [_runningBarAnimation stopAnimation:NO]; -// [_runningBarAnimation finishAnimationAtPosition:UIViewAnimatingPositionCurrent]; +// UIViewPropertyAnimator* retained = _runningBarAnimation; +// [retained stopAnimation:NO]; +// [retained finishAnimationAtPosition:UIViewAnimatingPositionCurrent]; // _runningBarAnimation = nil; // } // // if(_runningBarSidecarAnimation != nil) // { -// [_runningBarSidecarAnimation stopAnimation:NO]; -// [_runningBarSidecarAnimation finishAnimationAtPosition:UIViewAnimatingPositionCurrent]; +// UIViewPropertyAnimator* retained = _runningBarSidecarAnimation; +// [retained stopAnimation:NO]; +// [retained finishAnimationAtPosition:UIViewAnimatingPositionCurrent]; // _runningBarSidecarAnimation = nil; // } //} @@ -1276,8 +1279,9 @@ - (void)_addEventQueueResumptionStep:(UIViewPropertyAnimator*)animator //{ // if(_runningPopupAnimation != nil) // { -// [_runningPopupAnimation stopAnimation:NO]; -// [_runningPopupAnimation finishAnimationAtPosition:UIViewAnimatingPositionCurrent]; +// UIViewPropertyAnimator* retained = _runningPopupAnimation; +// [retained stopAnimation:NO]; +// [retained finishAnimationAtPosition:UIViewAnimatingPositionCurrent]; // _runningPopupAnimation = nil; // } //} @@ -1420,11 +1424,14 @@ - (void)_presentPopupBarWithContentViewController:(UIViewController*)contentView { [_runningBarSidecarAnimation startAnimation]; - [_runningBarAnimation stopAnimation:NO]; - [_runningBarAnimation finishAnimationAtPosition:UIViewAnimatingPositionEnd]; + UIViewPropertyAnimator* retained1 = _runningBarAnimation; + UIViewPropertyAnimator* retained2 = _runningBarSidecarAnimation; - [_runningBarSidecarAnimation stopAnimation:NO]; - [_runningBarSidecarAnimation finishAnimationAtPosition:UIViewAnimatingPositionEnd]; + [retained1 stopAnimation:NO]; + [retained1 finishAnimationAtPosition:UIViewAnimatingPositionEnd]; + + [retained2 stopAnimation:NO]; + [retained2 finishAnimationAtPosition:UIViewAnimatingPositionEnd]; } else { @@ -1603,8 +1610,9 @@ - (void)_dismissPopupBarAnimated:(BOOL)animated completion:(void(^)(void))comple if(animated == NO) { - [_runningBarAnimation stopAnimation:NO]; - [_runningBarAnimation finishAnimationAtPosition:UIViewAnimatingPositionEnd]; + UIViewPropertyAnimator* retained = _runningBarAnimation; + [retained stopAnimation:NO]; + [retained finishAnimationAtPosition:UIViewAnimatingPositionEnd]; } };