티스토리 뷰
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
'macOS, iOS' 카테고리의 다른 글
[iOS] 앱을 종료시키는 방법 (0) | 2021.03.31 |
---|---|
[SwiftUI] MFMailComposeViewController SwiftUI에서 사용해서 이메일 보내기 (0) | 2021.03.31 |
[iOS] 오늘 이전의 날짜 false, 오늘과 오늘 이후 true (0) | 2021.03.27 |
[SwiftUI] UITextView대신 TextEditor (0) | 2021.03.24 |
[SwiftUI] Image picker만들기 - PHPicker (0) | 2021.03.24 |