mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-05-19 00:38:10 +00:00
26 lines
680 B
Swift
26 lines
680 B
Swift
import Combine
|
|
import UIKit
|
|
|
|
@Observable public class SceneDelegate: NSObject, 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
|
|
|
|
#if targetEnvironment(macCatalyst)
|
|
if let titlebar = windowScene.titlebar {
|
|
titlebar.titleVisibility = .hidden
|
|
titlebar.toolbar = nil
|
|
}
|
|
#endif
|
|
}
|
|
}
|