Skip to content

Commit

Permalink
fixup! Fix topViewController search and add event listener description
Browse files Browse the repository at this point in the history
  • Loading branch information
ykyivskyi-gl committed Sep 23, 2024
1 parent c7aa32d commit a103b7a
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ class ContentViewPresenter: ObservableObject {
func showVisitorCode() {
var topViewController: UIViewController?
for scene in UIApplication.shared.connectedScenes {
if let windowScene = scene as? UIWindowScene {
for window in windowScene.windows {
if window.isKeyWindow {
topViewController = window.rootViewController
}
}
guard let windowScene = scene as? UIWindowScene else {
continue
}
for window in windowScene.windows where window.isKeyWindow {
topViewController = window.rootViewController
break
}
}

Expand Down Expand Up @@ -156,7 +156,7 @@ private extension ContentViewPresenter {
}
}

// Configure listening of Glia's events
// This is an example of how events are handled and could be observer in Glia Widgets
func eventListener() {
Glia.sharedInstance.onEvent = { event in
switch event {
Expand Down

0 comments on commit a103b7a

Please sign in to comment.