mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user