mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-08-19 09:08:26 +02:00
Fix deprecated and early window access warnings
This commit is contained in:
parent
9dd532285c
commit
713999eb83
1 changed files with 3 additions and 3 deletions
|
@ -5,7 +5,7 @@ import RealmSwift
|
||||||
@UIApplicationMain
|
@UIApplicationMain
|
||||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||||
|
|
||||||
var window: UIWindow?
|
lazy var window: UIWindow? = UIWindow(frame: UIScreen.main.bounds)
|
||||||
var backgroundCompletionHandler: (() -> Void)?
|
var backgroundCompletionHandler: (() -> Void)?
|
||||||
|
|
||||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
||||||
|
@ -83,10 +83,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||||
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
|
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
|
||||||
super.touchesBegan(touches, with: event)
|
super.touchesBegan(touches, with: event)
|
||||||
|
|
||||||
let statusBarRect = UIApplication.shared.statusBarFrame
|
let statusBarRect = self.window?.windowScene?.statusBarManager?.statusBarFrame
|
||||||
guard let touchPoint = event?.allTouches?.first?.location(in: self.window) else { return }
|
guard let touchPoint = event?.allTouches?.first?.location(in: self.window) else { return }
|
||||||
|
|
||||||
if statusBarRect.contains(touchPoint) {
|
if statusBarRect?.contains(touchPoint) ?? false {
|
||||||
NotificationCenter.default.post(name: .capacitorStatusBarTapped, object: nil)
|
NotificationCenter.default.post(name: .capacitorStatusBarTapped, object: nil)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue