fix(ios-frame): tearDownUI and reset UINavigationController (#6817)

This commit is contained in:
Alexander Djenkov
2019-02-06 22:11:13 +02:00
committed by Svetoslav
parent 97d878c107
commit cea97c6b45

View File

@ -23,8 +23,7 @@ let navDepth = -1;
export class Frame extends FrameBase { export class Frame extends FrameBase {
public viewController: UINavigationControllerImpl; public viewController: UINavigationControllerImpl;
public _animatedDelegate = <UINavigationControllerDelegate>UINavigationControllerAnimatedDelegate.new(); public _animatedDelegate = <UINavigationControllerDelegate>UINavigationControllerAnimatedDelegate.new();
public _ios: iOSFrame;
private _ios: iOSFrame;
constructor() { constructor() {
super(); super();
@ -219,20 +218,20 @@ export class Frame extends FrameBase {
switch (this._ios.navBarVisibility) { switch (this._ios.navBarVisibility) {
case "always": case "always":
return true; return true;
case "never": case "never":
return false; return false;
case "auto": case "auto":
let newValue: boolean; let newValue: boolean;
if (page && page.actionBarHidden !== undefined) { if (page && page.actionBarHidden !== undefined) {
newValue = !page.actionBarHidden; newValue = !page.actionBarHidden;
} }
else { else {
newValue = this.ios.controller.viewControllers.count > 1 || (page && page.actionBar && !page.actionBar._isEmpty()); newValue = this.ios.controller.viewControllers.count > 1 || (page && page.actionBar && !page.actionBar._isEmpty());
} }
newValue = !!newValue; // Make sure it is boolean newValue = !!newValue; // Make sure it is boolean
return newValue; return newValue;
} }
@ -390,6 +389,9 @@ class UINavigationControllerImpl extends UINavigationController {
const owner = this._owner.get(); const owner = this._owner.get();
if (owner && owner.isLoaded && !owner.parent && !this.presentedViewController) { if (owner && owner.isLoaded && !owner.parent && !this.presentedViewController) {
owner.callUnloaded(); owner.callUnloaded();
owner.viewController = null;
owner.ios.controller = null;
} }
} }
@ -596,6 +598,9 @@ class iOSFrame implements iOSFrameDefinition {
public get controller() { public get controller() {
return this._controller; return this._controller;
} }
public set controller(value: UINavigationControllerImpl) {
this._controller = value;
}
public get showNavigationBar(): boolean { public get showNavigationBar(): boolean {
return this._showNavigationBar; return this._showNavigationBar;