We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c93ced9 commit 82556a9Copy full SHA for 82556a9
Sources/SwiftBoost/UIKit/Extensions/UIApplicationExtension.swift
@@ -25,5 +25,16 @@ public extension UIApplication {
25
guard let rootViewController = scene.windows.first?.rootViewController else { return nil }
26
return rootViewController
27
}
28
+
29
+ var topController: UIViewController? {
30
+ if var topController = self.rootController {
31
+ while let presentedViewController = topController.presentedViewController {
32
+ topController = presentedViewController
33
+ }
34
+ return topController
35
36
+ return nil
37
38
39
40
#endif
0 commit comments