IceCubesApp/Packages/DesignSystem/Sources/DesignSystem/SceneDelegate.swift

26 lines
680 B
Swift
Raw Normal View History

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
2023-10-23 17:12:25 +00:00
#if targetEnvironment(macCatalyst)
if let titlebar = windowScene.titlebar {
titlebar.titleVisibility = .hidden
titlebar.toolbar = nil
}
#endif
}
}