IOS无法将类型的值“()”预期参数类型“串” SWIFT 3
答
只需使用像这样的swift 3选择器语法来改变你的选择器语法。
#selector(self.hideKeyboard)
答
在Swift 3中,Selector的语法已更改。如果选择器中没有参数,则不需要在选择器名称后添加圆括号。
let tapGesture = UITapGestureRecognizer(target: self, action: #selector(hideKeyboard))
self.view.addGestureRecognizer(tapGesture)
找到链接,它在哪里被解释。 [在Cocoa和Objective-C Swift 3中使用Swift](https://developer.apple.com/library/content/documentation/Swift/Conceptual/BuildingCocoaApps/InteractingWithObjective-CAPIs.html) –
[@selector( )在Swift?](http://*.com/questions/24007650/selector-in-swift) – Moritz