Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion packages/core/ui/frame/index.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { Trace } from '../../trace';
import { SlideTransition } from '../transition/slide-transition';
import { FadeTransition } from '../transition/fade-transition';
import { SharedTransition } from '../transition/shared-transition';
import type { Transition } from '../transition';

export * from './frame-common';

Expand Down Expand Up @@ -73,7 +74,11 @@ export class Frame extends FrameBase {
}

this._removeFromFrameStack();
this.viewController = null;

if (this.viewController) {
this.viewController.lastExecutingTransition = null;
this.viewController = null;
}

// This was the last frame so we can get rid of the controller delegate reference
if (this._isFrameStackEmpty()) {
Expand Down Expand Up @@ -475,6 +480,9 @@ class UINavigationControllerDelegateImpl extends NSObject implements UINavigatio
}
}

// Keep a strong reference of the last executing transition to prevent gc from collecting it
navigationController.lastExecutingTransition = transition;

if (transition?.iosNavigatedController) {
return transition.iosNavigatedController(navigationController, operation, fromVC, toVC);
}
Expand Down Expand Up @@ -509,6 +517,7 @@ class UINavigationControllerDelegateImpl extends NSObject implements UINavigatio
@NativeClass
class UINavigationControllerImpl extends UINavigationController {
private _owner: WeakRef<Frame>;
public lastExecutingTransition: Transition;

public static initWithOwner(owner: WeakRef<Frame>): UINavigationControllerImpl {
const navigationBarClass = owner.deref()?.iosNavigationBarClass ?? null;
Expand Down