diff --git a/AgileWorks/AgileWorks/Login/View/LoginViewController.swift b/AgileWorks/AgileWorks/Login/View/LoginViewController.swift index f49abf4ceff9df4802168694e57e2c854b05e38e..c321e43ddd463c55c3837c5412863e7b6a90fcb4 100644 --- a/AgileWorks/AgileWorks/Login/View/LoginViewController.swift +++ b/AgileWorks/AgileWorks/Login/View/LoginViewController.swift @@ -82,6 +82,13 @@ class LoginViewController: UIViewController { NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillShow(_:)), name: UIResponder.keyboardWillShowNotification, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillHide(_:)), name: UIResponder.keyboardWillHideNotification, object: nil) + let tapGR = UITapGestureRecognizer(target: self, action: #selector(dismissKeyboard)) + tapGR.cancelsTouchesInView = false + self.view.addGestureRecognizer(tapGR) + } + @objc + func dismissKeyboard() { + self.view.endEditing(true) } //ログイン画面の固定文言表示 @@ -329,8 +336,10 @@ extension LoginViewController: LoginView { extension LoginViewController { @objc private func keyboardWillShow(_ notification: Notification) { + /* guard let keyboardHeight = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue.height else { return } scrollViewBottomConstraint.constant = view.safeAreaInsets.bottom - keyboardHeight + */ view.layoutIfNeeded() }