Extending existing protocol to conform to another

2019-07-09 00:37发布

Hello my goal here is to extend (in swift 3) a protocol I have in a framework to conform to another Protocol

protocol SomeProtocol {}
protocol SomeOtherProtocol {}
extension SomeOtherProtocol: SomeProtocol {}

The problem here is that I get an error: "Extension of protocol 'SomeOtherProtocol' cannot have an inheritance clause" If this is not possible how do I achieve such thing or what's the "swift way"?

0条回答
登录 后发表回答