Skip to content

Commit 8282e6e

Browse files
committed
Added default values for logger and get root controller.
1 parent 0148d12 commit 8282e6e

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Sources/SwiftBoost/Foundation/Logger.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Foundation
99
*/
1010
public enum Logger {
1111

12-
public static func configure(levels: [Level], fileNameMode: FileNameMode) {
12+
public static func configure(levels: [Level] = Level.allCases, fileNameMode: FileNameMode = .show) {
1313
Configurator.shared.levels = levels
1414
Configurator.shared.fileNameMode = fileNameMode
1515
}

Sources/SwiftBoost/UIKit/Extensions/UIApplicationExtension.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,11 @@ public extension UIApplication {
1919
}
2020
}
2121
}
22+
23+
var rootController: UIViewController? {
24+
guard let scene = UIApplication.shared.connectedScenes.first as? UIWindowScene else { return nil }
25+
guard let rootViewController = scene.windows.first?.rootViewController else { return nil }
26+
return rootViewController
27+
}
2228
}
2329
#endif

0 commit comments

Comments
 (0)