fix(embed): use factory only when it's available (#10579)

When embedding via 'ns embed ios', the .swift symbols may not be available and are not needed. This can be revisited in the future with project settings for embedded projects.
This commit is contained in:
Nathan Walker
2024-07-09 14:40:40 -07:00
committed by GitHub
parent 0e2db6e586
commit 9541b1b68c

View File

@@ -65,7 +65,7 @@ export function getRootViewController(): UIViewController {
export function getWindow(): UIWindow {
let window: UIWindow;
if (SDK_VERSION >= 15) {
if (SDK_VERSION >= 15 && typeof NativeScriptViewFactory !== 'undefined') {
// UIWindowScene.keyWindow is only available 15+
window = NativeScriptViewFactory.getKeyWindow();
}