티스토리 뷰
macOS, iOS
textFieldDelegate로 리턴버튼이나 textField 바깥 영역 눌렀을 때 keyboard dismiss
SweetDev 2019. 11. 22. 18:53//This is for the keyboard to GO AWAYY !! when user clicks anywhere on the view
override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
self.view.endEditing(true)
}
//This is for the keyboard to GO AWAYY !! when user clicks "Return" key on the keyboard
func textFieldShouldReturn(textField: UITextField) -> Bool {
textField.resignFirstResponder()
return true
}
'macOS, iOS' 카테고리의 다른 글
@escaping , a.k.a. 탈출 클로저 (0) | 2019.12.05 |
---|---|
아카이브 이후에 나오는 페이지 보는 법 (0) | 2019.11.30 |
카카오맵 왜 옵젝씨밖에 없냐 ㅡㅡ (0) | 2019.11.22 |
xib로 만든 파일을, 다른 스토리보드에서도 렌더링해서 보고 싶다면? (0) | 2019.11.15 |
[Swift] typealias (0) | 2019.11.13 |