일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- 예외처리
- 커스텀팝업
- Xcode
- C언어
- 준코딩
- android java
- 안드로이드
- Android
- 보호와 보안
- FLUTTER
- 연결리스트
- text to speech
- Android Studio
- swift baekjoon
- Swift
- 백준
- 자바
- xocde
- 링크드리스트
- BAEKJOON
- IOS
- label
- TextField
- customPopup
- 플러터
- storyboard
- Firebase
- deeplink
- 안드로이드스튜디오
- 버블정렬
Archives
- Today
- Total
준코딩
[ios/Swift] 화면 터치 시 키보드 내리기 본문
올라오는 키보드 때문에 화면이 가려져 다음 액션이 불가한 경우 화면을 터치해서 키보드를 내리는 코드입니다
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?){
self.view.endEditing(true)
}
위 코드를 viewController 아무곳이나 넣으시면 됩니다
//
// ViewController.swift
// KeyboardDown
//
// Created by 이준협 on 2023/01/09.
//
import UIKit
class ViewController: UIViewController {
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?){
self.view.endEditing(true)
}
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
}
https://github.com/Ljunhyeob/keyboardDown
GitHub - Ljunhyeob/keyboardDown: 키보드 내리기
키보드 내리기. Contribute to Ljunhyeob/keyboardDown development by creating an account on GitHub.
github.com
'프로그래밍 > IOS (Swift)' 카테고리의 다른 글
[ios/Swift] pinchGesture 사용하기 (이미지 확대/축소 하기) (0) | 2023.01.12 |
---|---|
[ios/Swift] 다크모드/라이트모드 막기 (0) | 2023.01.10 |
[Swift] sort() 와 sorted() 차이점. (0) | 2023.01.03 |
(ios/Swift) Base64 인코딩, 디코딩 (0) | 2023.01.02 |
(ios/Swift) 라이브러리 Alamofire 사용하기 - GET 하기 (0) | 2023.01.01 |
Comments