首页 文章
  • 3 votes
     answers
     views

    Swift协议仅由特定类实现

    我想创建一个仅由特定类及其子类在swift中采用的协议 . 我知道我可以使用这样的协议扩展 protocol PeopleProtocol: class { } extension PeopleProtocol where Self: People { } 但是我的协议中的方法将是一个 init 方法,它将由类或其subClasess实现,并且只返回某些特定类型的对象 . 这...

热门问题