회원가입 페이지

This commit is contained in:
Yu Sung
2023-08-09 19:27:53 +09:00
parent 1bc62f8fbd
commit 6953ce3e3e
19 changed files with 830 additions and 8 deletions

View File

@@ -0,0 +1,29 @@
//
// KeyboardHandler.swift
// SodaLive
//
// Created by klaus on 2023/08/09.
//
import SwiftUI
import Combine
final class KeyboardHandler: ObservableObject {
@Published private(set) var keyboardHeight: CGFloat = 0
private var cancellable: AnyCancellable?
private let keyboardWillShow = NotificationCenter.default
.publisher(for: UIResponder.keyboardWillShowNotification)
.compactMap { ($0.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? CGRect)?.height }
private let keyboardWillHide = NotificationCenter.default
.publisher(for: UIResponder.keyboardWillHideNotification)
.map { _ in CGFloat.zero }
init() {
cancellable = Publishers.Merge(keyboardWillShow, keyboardWillHide)
.subscribe(on: DispatchQueue.main)
.assign(to: \.self.keyboardHeight, on: self)
}
}