Skip to content

Commit

Permalink
fix detect rootViewController code
Browse files Browse the repository at this point in the history
  • Loading branch information
frontegg-david committed Jan 11, 2024
1 parent 8b0aba8 commit 5be1faf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Sources/FronteggSwift/FronteggAuth.swift
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,15 @@ public class FronteggAuth: ObservableObject {

internal func getRootVC() -> UIViewController? {


if let appDelegate = UIApplication.shared.delegate,
let window = appDelegate.window,
let rootVC = window?.rootViewController {
if let presented = rootVC.presentedViewController {
return presented
}else {
return rootVC
}
}

if let rootVC = UIWindow.key?.rootViewController {
Expand Down

0 comments on commit 5be1faf

Please sign in to comment.