Skip to content

Commit

Permalink
[Feat/#38] UIViewController KeyboardDismiss 로직 작성
Browse files Browse the repository at this point in the history
  • Loading branch information
FpRaArNkK committed Feb 25, 2025
1 parent 78a49dd commit c8b921c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 179 deletions.

This file was deleted.

34 changes: 0 additions & 34 deletions Noostak_iOS/Noostak_iOS/Global/Components/PaddedTextField.swift

This file was deleted.

21 changes: 21 additions & 0 deletions Noostak_iOS/Noostak_iOS/Global/Extension/UIViewController+.swift
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)
}
}

0 comments on commit c8b921c

Please sign in to comment.