overrIDe func touchesBegan(touches: Set<UItouch>,withEvent event: UIEvent?) { self.vIEw.endEditing(true)}
但现在在Xcode 8 beta中我收到此错误:
声明touchBegan(touches:withEvent)具有来自任何潜在覆盖的不同参数名称.
有什么想法吗?
解决方法 这对我有用:overrIDe func touchesBegan(_ touches: Set<UItouch>,with event: UIEvent?) { self.vIEw.endEditing(true)}
请注意函数参数中非常微妙的Swift 3更新.在The Swift Programming Language (Swift 3)页的第20页和第21页,他们解释说:
“By default,functions use their parameter names as labels for their arguments. Write a custom argument label before the parameter name,or write _ to use no argument label.”
总结
以上是内存溢出为你收集整理的ios – Xcode 8 – 当用户点击背景时,键盘会消失全部内容,希望文章能够帮你解决ios – Xcode 8 – 当用户点击背景时,键盘会消失所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)