mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
feat(application): expose inBackground and suspended (#9897)
For IOSApplication to be like AndroidApplication
This commit is contained in:
committed by
Nathan Walker
parent
665009b863
commit
8987babb08
@@ -20,7 +20,7 @@ import { profile } from '../profiling';
|
||||
import { iOSNativeHelper } from '../utils';
|
||||
import { initAccessibilityCssHelper } from '../accessibility/accessibility-css-helper';
|
||||
import { initAccessibilityFontScale } from '../accessibility/font-scale';
|
||||
import { setInBackground, setSuspended } from './application-common';
|
||||
import { inBackground, setInBackground, setSuspended, suspended } from './application-common';
|
||||
|
||||
const IOS_PLATFORM = 'ios';
|
||||
|
||||
@@ -138,6 +138,13 @@ export class iOSApplication implements iOSApplicationDefinition {
|
||||
private _rootView: View;
|
||||
private _systemAppearance: 'light' | 'dark';
|
||||
|
||||
get paused() {
|
||||
return suspended;
|
||||
}
|
||||
get backgrounded() {
|
||||
return inBackground;
|
||||
}
|
||||
|
||||
constructor() {
|
||||
this._observers = new Array<NotificationObserver>();
|
||||
this.addNotificationObserver(UIApplicationDidFinishLaunchingNotification, this.didFinishLaunchingWithOptions.bind(this));
|
||||
|
||||
Reference in New Issue
Block a user