作者热门文章
- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
从 Xcode 8 beta 6 开始,我现在在其定义模块之外收到编译错误“无法从非开放类 (Class) 继承”
我继承的类是单独的 Swift 框架的一部分,但我的项目是为 Xcode 8 beta 5 编译的。我需要更改什么才能让我的项目再次编译?
最佳答案
我自己找到了答案。
在 Swift 3 中,您现在可以将类标记为 open
而不是 public
这允许模块外部的文件子类化该类。
只需将模块类中的 public
替换为 open
。
引用 here .
关于swift - "Cannot inherit from non-open class" swift ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38979371/
我是一名优秀的程序员,十分优秀!