zoukankan      html  css  js  c++  java
  • iOS升级swift3 遇到Overriding non-open instance method outside of its defining module的解决方案

    最近将我之前的一个swift项目升级swift3,说多了都是泪。。。

    其中,遇到这样一个错误:

    这是用的三方:ENSwiftSideMenu时引出的

    报了两个错:

    1、Cannot inherit from non-open class 'ENSideMenuNavigationController' outside of its defining module

    2、Overriding non-open instance method outside of its defining module

    之前swift2.3明明都是OK的,现在变这样了,对比了下,发现是这个导致的:

    swift2.3:

    swift3.0

    然后,我将public写成open后,重新run就ok了。。。

    open:公开的,内部外部模块都可访问,这个开放性最大;public:也是公开的,但还是与open有所区别。

    open与public区别:public在只能限制在定义所在模块内部进行继承与方法的重写,而open则是只要模块有被import,在可在此模块中继承或者重写被import进来的模块中的类或方法。

  • 相关阅读:
    cmake使用
    CMake...
    信息熵相关知识总结
    最强NLP模型-BERT
    问答系统总结
    检索问答模型
    文本分类-TextCNN
    机器学习-Logistic回归
    Attention注意力机制介绍
    机器学习-聚类Clustering
  • 原文地址:https://www.cnblogs.com/yajunLi/p/6383047.html
Copyright © 2011-2022 走看看