Skip to content

Commit 0c51b3e

Browse files
author
JWI
committed
a
1 parent b23b7e4 commit 0c51b3e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Sources/UIKitBackend/UIKitBackend.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,15 +214,22 @@ open class ApplicationDelegate: UIResponder, UIApplicationDelegate {
214214
_ application: UIApplication,
215215
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
216216
) -> Bool {
217+
if UIKitBackend.mainWindow == nil {
218+
let window = UIWindow(frame: UIScreen.main.bounds)
219+
window.rootViewController = RootViewController(backend: UIKitBackend()) // Your main VC
220+
window.makeKeyAndVisible()
221+
UIKitBackend.mainWindow = window
222+
}
223+
217224
if let onReceiveURL = UIKitBackend.onReceiveURL,
218-
let url = launchOptions?[.url] as? URL
219-
{
225+
let url = launchOptions?[.url] as? URL {
220226
onReceiveURL(url)
221227
}
222228

223229
return true
224230
}
225231

232+
226233
/// Asks the delegate to open a resource specified by a URL, and provides a dictionary of launch options.
227234
///
228235
/// If you override this method in a subclass, you should call

0 commit comments

Comments
 (0)