0
我的UIViewController(FirtViewController)在我的故事板... 在分配给该UIViewController的斯威夫特文件我添加自定义的UIView如何隐藏键盘自定义的UIView?
let customView = NSBundle.mainBundle().loadNibNamed("CustomView", owner: self, options: nil)[0] as! CustomView
self.view.addSubview(customView)
在这种customView我有一个文本框。 在分配给该customView迅速文件我有功能:
func textFieldShouldReturn(textField: UITextField) -> Bool {
textField.resignFirstResponder()
return true
}
但是,当我按下“返回键”我的键盘不隐瞒!
哪里是我的错?
当我加入这样的代码我有一个错误:无法分配型FirstViewController的价值键入UITextFieldDelegate? – Dmitry
@Dmitry我编辑我的职务。 – tktsubota
感谢您快速的解答! – Dmitry