Loo*_*zie 2 xcode compiler-errors objective-c swift swift4
我有使用Swift 3.2和Objective-C编译与Xcode版本9.0(9A235)的项目.它在Swift 3.2中编译得很好.但是,当我切换到Swift 4.0时,在Swift中声明的方法在Objective-C中不再可见.错误是No visible @interface "UserAPI" declares the selector ...
你应该在你的函数之前添加@objc.
@objc func doSomething() {
//Some code goes here
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2004 次 |
| 最近记录: |