Dismissing the keyboard in a UIScrollView

后端 未结 12 2309
醉话见心
醉话见心 2020-11-30 20:18

Alright, I have a couple of UITextFields and UITextViews inside a UIScrollView, and I\'d like to set the keyboard to disappear wheneve

12条回答
  •  情书的邮戳
    2020-11-30 21:05

    A bit late but if anyone else is searching an answer to this problem with Swift 3:

    func scrollViewDidScroll(_ scrollView: UIScrollView) {
        view.endEditing(true)
    }
    

提交回复
热议问题