티스토리 뷰

sceneDelegate에서 받아와서, public으로 저장하고 쓰고 있당

 

  func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
    // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
    // If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
    // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).

    // Create the SwiftUI view that provides the window contents.
    
    let contentView =
      TabViewScene()
//      SNSLoginScene()
    
    // Use a UIHostingController as window root view controller.
    if let windowScene = scene as? UIWindowScene {
      let window = UIWindow(windowScene: windowScene)
      window.rootViewController = UIHostingController(rootView: contentView)
      
      safeTop = window.safeAreaInsets.top
      safeBottom = window.safeAreaInsets.bottom
      
      self.window = window
      window.makeKeyAndVisible()
    }
    ...


Constant.swift

public var safeTop: CGFloat = 0.0
public var safeBottom: CGFloat = 0.0
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/12   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
글 보관함