mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-05-19 08:48:16 +00:00
d1209e6704
Co-authored-by: Jim Dovey <jimdovey@apple.com>
19 lines
509 B
Swift
19 lines
509 B
Swift
import Combine
|
|
import UIKit
|
|
|
|
public class SceneDelegate: NSObject, ObservableObject, UIWindowSceneDelegate {
|
|
public var window: UIWindow?
|
|
|
|
public var windowWidth: CGFloat {
|
|
window?.bounds.size.width ?? UIScreen.main.bounds.size.width
|
|
}
|
|
|
|
public func scene(_ scene: UIScene,
|
|
willConnectTo _: UISceneSession,
|
|
options _: UIScene.ConnectionOptions)
|
|
{
|
|
guard let windowScene = scene as? UIWindowScene else { return }
|
|
window = windowScene.keyWindow
|
|
}
|
|
}
|