【发布时间】:2015-11-17 08:56:24
【问题描述】:
我在这里阅读了几篇关于同样问题的帖子,但主要是因为我在 IOS 开发方面很新,而且我使用 swift,所以无法理解它们。我什至找不到术语“子类化”的定义,也许它只是 obj-c?
无论如何,我有一个带有静态单元格的 tableview 控制器,以及一个单元格中的文本字段。当用户在编辑文本字段时点击不同的区域时,我需要关闭键盘。在这里阅读帖子后,我将 touchesBegan 内容更改如下:
override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
self.view.endEditing(true)
self.nextResponder()?.touchesBegan(touches, withEvent: event)
super.touchesBegan(touches, withEvent: event)
}
我仍然没有接触到定义为的 tableviewcontroller:
class addNew: UITableViewController, UITextFieldDelegate {
【问题讨论】:
标签: swift uitableview tableview touchesbegan