File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -506,6 +506,12 @@ fileprivate extension StateViewController {
506506 return false
507507 }
508508
509+ // We may not have made any changes to content view controllers, even though we have changed the state.
510+ // Therefore, we must be prepare to end the state transition immediately.
511+ defer {
512+ endStateTransitionIfNeeded ( animated: animated)
513+ }
514+
509515 // If we're transitioning between states, we need to abort and wait for the current state
510516 // transition to finish.
511517 guard isTransitioningBetweenStates == false else {
@@ -517,11 +523,6 @@ fileprivate extension StateViewController {
517523 willTransition ( to: state, animated: animated)
518524 dispatchStateEvent ( . willTransitionTo( nextState: state, animated: animated) )
519525
520- // We may not have made any changes to content view controllers, even though we have changed the state.
521- // Therefore, we must be prepare to end the state transition immediately.
522- defer {
523- endStateTransitionIfNeeded ( animated: animated)
524- }
525526
526527 // Note that we're transitioning from a state
527528 transitioningFromState = state
You can’t perform that action at this time.
0 commit comments