1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-13 22:00:31 +05:30
yattee/iOS/AppDelegate.swift

31 lines
1.0 KiB
Swift
Raw Normal View History

import Foundation
import UIKit
final class AppDelegate: UIResponder, UIApplicationDelegate {
var orientationLock = UIInterfaceOrientationMask.all
private(set) static var instance: AppDelegate!
func application(_: UIApplication, supportedInterfaceOrientationsFor _: UIWindow?) -> UIInterfaceOrientationMask {
orientationLock
}
func application(_: UIApplication, didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool { // swiftlint:disable:this discouraged_optional_collection
2022-05-21 01:23:17 +05:30
Self.instance = self
2022-06-22 03:48:16 +05:30
#if os(iOS)
UIViewController.swizzleHomeIndicatorProperty()
2022-06-29 00:41:28 +05:30
2022-07-10 03:59:13 +05:30
OrientationTracker.shared.startDeviceOrientationTracking()
2022-06-22 03:48:16 +05:30
#endif
return true
}
2024-05-16 21:58:32 +05:30
func application(_: UIApplication, open url: URL, options _: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
2024-04-25 22:31:44 +05:30
if url.scheme == "yattee" {
2024-05-16 22:23:47 +05:30
OpenURLHandler(navigationStyle: Constants.defaultNavigationStyle).handle(url)
2024-04-25 22:48:10 +05:30
return true
2024-04-25 22:31:44 +05:30
}
return false
}
}