Skip to content

Commit f16886a

Browse files
committed
[#234] 완료하기 버튼이 키보드에 의해 움직이지 않게 처리
1 parent 0a3153d commit f16886a

File tree

1 file changed

+44
-44
lines changed

1 file changed

+44
-44
lines changed

EATSSU/App/Sources/Presentation/MyPage/ViewController/MyInfoViewController.swift

+44-44
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ final class MyInfoViewController: BaseViewController {
3232

3333
override func viewWillAppear(_ animated: Bool) {
3434
super.viewWillAppear(animated)
35-
addKeyboardNotifications()
35+
// addKeyboardNotifications()
3636
}
3737

3838
override func viewWillDisappear(_ animated: Bool) {
3939
super.viewWillDisappear(animated)
40-
removeKeyboardNotifications()
40+
// removeKeyboardNotifications()
4141
}
4242

4343
// MARK: - UI 설정
@@ -78,48 +78,48 @@ final class MyInfoViewController: BaseViewController {
7878

7979
// MARK: - 키보드 감지
8080

81-
/// 키보드 이벤트 감지를 위한 옵저버를 추가합니다.
82-
func addKeyboardNotifications() {
83-
NotificationCenter.default.addObserver(self,
84-
selector: #selector(keyboardWillShow(_:)),
85-
name: UIResponder.keyboardWillShowNotification,
86-
object: nil)
87-
NotificationCenter.default.addObserver(self,
88-
selector: #selector(keyboardWillHide(_:)),
89-
name: UIResponder.keyboardWillHideNotification,
90-
object: nil)
91-
}
92-
93-
/// 키보드 이벤트 옵저버를 제거합니다.
94-
func removeKeyboardNotifications() {
95-
NotificationCenter.default.removeObserver(self,
96-
name: UIResponder.keyboardWillShowNotification,
97-
object: nil)
98-
NotificationCenter.default.removeObserver(self,
99-
name: UIResponder.keyboardWillHideNotification,
100-
object: nil)
101-
}
102-
103-
/// 키보드가 나타날 때 호출됩니다.
104-
@objc
105-
func keyboardWillShow(_ notification: Notification) {
106-
if let keyboardSize = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue {
107-
let updateKeyboardHeight = keyboardSize.height
108-
let difference = updateKeyboardHeight - currentKeyboardHeight
109-
110-
myInfoView.completeButton.frame.origin.y -= difference
111-
currentKeyboardHeight = updateKeyboardHeight
112-
}
113-
}
114-
115-
/// 키보드가 사라질 때 호출됩니다.
116-
@objc
117-
func keyboardWillHide(_ notification: Notification) {
118-
if ((notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue) != nil {
119-
myInfoView.completeButton.frame.origin.y += currentKeyboardHeight
120-
currentKeyboardHeight = 0.0
121-
}
122-
}
81+
// /// 키보드 이벤트 감지를 위한 옵저버를 추가합니다.
82+
// func addKeyboardNotifications() {
83+
// NotificationCenter.default.addObserver(self,
84+
// selector: #selector(keyboardWillShow(_:)),
85+
// name: UIResponder.keyboardWillShowNotification,
86+
// object: nil)
87+
// NotificationCenter.default.addObserver(self,
88+
// selector: #selector(keyboardWillHide(_:)),
89+
// name: UIResponder.keyboardWillHideNotification,
90+
// object: nil)
91+
// }
92+
//
93+
// /// 키보드 이벤트 옵저버를 제거합니다.
94+
// func removeKeyboardNotifications() {
95+
// NotificationCenter.default.removeObserver(self,
96+
// name: UIResponder.keyboardWillShowNotification,
97+
// object: nil)
98+
// NotificationCenter.default.removeObserver(self,
99+
// name: UIResponder.keyboardWillHideNotification,
100+
// object: nil)
101+
// }
102+
//
103+
// /// 키보드가 나타날 때 호출됩니다.
104+
// @objc
105+
// func keyboardWillShow(_ notification: Notification) {
106+
// if let keyboardSize = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue {
107+
// let updateKeyboardHeight = keyboardSize.height
108+
// let difference = updateKeyboardHeight - currentKeyboardHeight
109+
//
110+
// myInfoView.completeButton.frame.origin.y -= difference
111+
// currentKeyboardHeight = updateKeyboardHeight
112+
// }
113+
// }
114+
//
115+
// /// 키보드가 사라질 때 호출됩니다.
116+
// @objc
117+
// func keyboardWillHide(_ notification: Notification) {
118+
// if ((notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue) != nil {
119+
// myInfoView.completeButton.frame.origin.y += currentKeyboardHeight
120+
// currentKeyboardHeight = 0.0
121+
// }
122+
// }
123123
}
124124

125125
// MARK: - 네트워크 요청

0 commit comments

Comments
 (0)