-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feat/#38] UIViewController KeyboardDismiss 로직 작성
- Loading branch information
Showing
3 changed files
with
21 additions
and
179 deletions.
There are no files selected for viewing
145 changes: 0 additions & 145 deletions
145
Noostak_iOS/Noostak_iOS/Global/Components/AppColorUnderlineTextField.swift
This file was deleted.
Oops, something went wrong.
34 changes: 0 additions & 34 deletions
34
Noostak_iOS/Noostak_iOS/Global/Components/PaddedTextField.swift
This file was deleted.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
Noostak_iOS/Noostak_iOS/Global/Extension/UIViewController+.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// | ||
// UIViewController+.swift | ||
// Noostak_iOS | ||
// | ||
// Created by 박민서 on 2/25/25. | ||
// | ||
|
||
import UIKit | ||
|
||
extension UIViewController { | ||
/// 화면을 탭하면 키보드를 내리는 기능을 추가하는 메서드 | ||
func hideKeyboardWhenTappedAround() { | ||
let tapGesture = UITapGestureRecognizer(target: self, action: #selector(dismissKeyboard)) | ||
tapGesture.cancelsTouchesInView = false | ||
view.addGestureRecognizer(tapGesture) | ||
} | ||
|
||
@objc private func dismissKeyboard() { | ||
view.endEditing(true) | ||
} | ||
} |