Skip to content

Commit

Permalink
Merge pull request #24 from noppefoxwolf/multiple-scenes
Browse files Browse the repository at this point in the history
Support multiple window
  • Loading branch information
noppefoxwolf authored Dec 18, 2021
2 parents 4fff0ac + cb7fe6d commit 3fd2f47
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Sources/DebugMenu/View/InAppDebuggerWindow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ protocol TouchThrowing {}

@available(iOSApplicationExtension, unavailable)
public class InAppDebuggerWindow: UIWindow {
internal static var shared: InAppDebuggerWindow!
internal static var windows: [InAppDebuggerWindow] = []

internal static func install(
windowScene: UIWindowScene? = nil,
Expand Down Expand Up @@ -46,15 +46,16 @@ public class InAppDebuggerWindow: UIWindow {
options: [Options]
) {
let keyWindow = UIApplication.shared.findKeyWindow()
shared = factory()
shared.windowLevel = UIWindow.Level.statusBar + 1
shared.rootViewController = FloatingViewController(
let window = factory()
window.windowLevel = UIWindow.Level.statusBar + 1
window.rootViewController = FloatingViewController(
debuggerItems: debuggerItems,
dashboardItems: dashboardItems,
options: options
)
shared!.makeKeyAndVisible()
window.makeKeyAndVisible()
keyWindow?.makeKeyAndVisible()
windows.append(window)
}

internal required init?(coder: NSCoder) { fatalError() }
Expand Down

0 comments on commit 3fd2f47

Please sign in to comment.