【问题标题】:What is difference between swift protocol with and without class inheritance? and when to use class inherited and not inherited protocol? [duplicate]带有和不带有类继承的swift协议有什么区别?以及何时使用继承的类而不是继承的协议? [复制]
【发布时间】:2018-07-23 12:54:43
【问题描述】:

我无法理解以下代码之间的区别以及我们需要使用这两种协议的场景。

    protocol protocolName {} 
    protocol protocolName: class {}

提前致谢。

【问题讨论】:

    标签: ios swift


    【解决方案1】:

    这个

    protocol protocolName: class {}
    

    只能被类采用

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-06-23
      • 1970-01-01
      • 1970-01-01
      • 2021-09-21
      • 1970-01-01
      • 2018-02-14
      • 1970-01-01
      相关资源
      最近更新 更多