Swift protocol extension method dispatch with superclass and subclass

后端 未结 3 709
囚心锁ツ
囚心锁ツ 2020-12-17 22:30

I found an interesting behaviour which seems like a bug...

Based on the behaviour described the following articles:

https://medium.com/ios-os-x-development/s

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-17 22:41

    An option that hasn't been considered is to split up your protocol into several smaller ones, such that the superclass does not need to conform to protocols containing methods it does not intend to implement. The subclass can then subscribe to these other protocols separately.

提交回复
热议问题