@@ -14,6 +14,7 @@ import { Trace } from '../../trace';
1414import { SlideTransition } from '../transition/slide-transition' ;
1515import { FadeTransition } from '../transition/fade-transition' ;
1616import { SharedTransition } from '../transition/shared-transition' ;
17+ import type { Transition } from '../transition' ;
1718
1819export * from './frame-common' ;
1920
@@ -73,7 +74,11 @@ export class Frame extends FrameBase {
7374 }
7475
7576 this . _removeFromFrameStack ( ) ;
76- this . viewController = null ;
77+
78+ if ( this . viewController ) {
79+ this . viewController . lastExecutingTransition = null ;
80+ this . viewController = null ;
81+ }
7782
7883 // This was the last frame so we can get rid of the controller delegate reference
7984 if ( this . _isFrameStackEmpty ( ) ) {
@@ -475,6 +480,9 @@ class UINavigationControllerDelegateImpl extends NSObject implements UINavigatio
475480 }
476481 }
477482
483+ // Keep a strong reference of the last executing transition to prevent gc from collecting it
484+ navigationController . lastExecutingTransition = transition ;
485+
478486 if ( transition ?. iosNavigatedController ) {
479487 return transition . iosNavigatedController ( navigationController , operation , fromVC , toVC ) ;
480488 }
@@ -509,6 +517,7 @@ class UINavigationControllerDelegateImpl extends NSObject implements UINavigatio
509517@NativeClass
510518class UINavigationControllerImpl extends UINavigationController {
511519 private _owner : WeakRef < Frame > ;
520+ public lastExecutingTransition : Transition ;
512521
513522 public static initWithOwner ( owner : WeakRef < Frame > ) : UINavigationControllerImpl {
514523 const navigationBarClass = owner . deref ( ) ?. iosNavigationBarClass ?? null ;
0 commit comments