Call loaded/unloaded on the rootView when application is resumed/suspended

Remove dead code from frame.ios
This commit is contained in:
Hristo Hristov
2017-12-15 15:26:23 +02:00
parent 4e74c37313
commit 33cd058718
2 changed files with 31 additions and 17 deletions

View File

@@ -126,6 +126,11 @@ class IOSApplication implements IOSApplicationDefinition {
const ios = utils.ios.getter(UIApplication, UIApplication.sharedApplication);
const object = this;
notify(<ApplicationEventData>{ eventName: resumeEvent, object, ios });
const rootView = this._rootView;
if (rootView && !rootView.isLoaded) {
rootView.callLoaded();
}
if (!displayedOnce) {
notify(<ApplicationEventData>{ eventName: displayedEvent, object, ios });
displayedOnce = true;
@@ -134,10 +139,18 @@ class IOSApplication implements IOSApplicationDefinition {
private didEnterBackground(notification: NSNotification) {
notify(<ApplicationEventData>{ eventName: suspendEvent, object: this, ios: utils.ios.getter(UIApplication, UIApplication.sharedApplication) });
const rootView = this._rootView;
if (rootView && rootView.isLoaded) {
rootView.callUnloaded();
}
}
private willTerminate(notification: NSNotification) {
notify(<ApplicationEventData>{ eventName: exitEvent, object: this, ios: utils.ios.getter(UIApplication, UIApplication.sharedApplication) });
const rootView = this._rootView;
if (rootView && rootView.isLoaded) {
rootView.callUnloaded();
}
}
private didReceiveMemoryWarning(notification: NSNotification) {