MCPcopy Create free account
hub / github.com/NativeScript/NativeScript / getWindow

Function getWindow

packages/core/utils/native-helper.ios.ts:179–193  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

177}
178
179export function getWindow(): UIWindow {
180 let window: UIWindow;
181 if (SDK_VERSION >= 15 && typeof NativeScriptViewFactory !== 'undefined') {
182 // UIWindowScene.keyWindow is only available 15+
183 window = NativeScriptViewFactory.getKeyWindow();
184 }
185 if (window) {
186 return window;
187 }
188 const app = UIApplication.sharedApplication;
189 if (!app) {
190 return;
191 }
192 return app.keyWindow || (app.windows && app.windows.count > 0 && app.windows.objectAtIndex(0));
193}
194
195function getMainScreen(): UIScreen {
196 const window = getWindow();

Callers 7

screenMethod · 0.90
runAsEmbeddedAppMethod · 0.90
windowMethod · 0.90
getRootViewControllerFunction · 0.70
getMainScreenFunction · 0.70
setWindowBackgroundColorFunction · 0.70
getViewControllerMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected