2023-02-27 05:39:07 +00:00
|
|
|
import Combine
|
2023-01-23 17:43:48 +00:00
|
|
|
import UIKit
|
|
|
|
|
|
|
|
public class SceneDelegate: NSObject, ObservableObject, UIWindowSceneDelegate {
|
|
|
|
public var window: UIWindow?
|
2023-01-25 12:02:28 +00:00
|
|
|
|
2023-01-23 17:43:48 +00:00
|
|
|
public var windowWidth: CGFloat {
|
|
|
|
window?.bounds.size.width ?? UIScreen.main.bounds.size.width
|
|
|
|
}
|
2023-01-25 12:02:28 +00:00
|
|
|
|
2023-01-23 17:43:48 +00:00
|
|
|
public func scene(_ scene: UIScene,
|
2023-01-25 12:02:28 +00:00
|
|
|
willConnectTo _: UISceneSession,
|
|
|
|
options _: UIScene.ConnectionOptions)
|
|
|
|
{
|
2023-01-23 17:43:48 +00:00
|
|
|
guard let windowScene = scene as? UIWindowScene else { return }
|
2023-01-25 12:02:28 +00:00
|
|
|
window = windowScene.keyWindow
|
2023-01-23 17:43:48 +00:00
|
|
|
}
|
|
|
|
}
|