Does a subclass inherit the protocols of its parent class in Objective-C?

后端 未结 1 1344
再見小時候
再見小時候 2021-02-18 14:30

Suppose I have a parent class that implements a protocol:

@interface GameViewController : UIViewController {
  ...
}

A

相关标签:
1条回答
  • 2021-02-18 15:11

    Referring to Apple's documentation: Your subclass does inherit the adoption of the protocol, so you don't have to adopt it again.

    Conforming to a Protocol

    A class is said to conform to a formal protocol if it adopts the protocol or inherits from another class that adopts it. An instance of a class is said to conform to the same set of protocols its class conforms to.

    0 讨论(0)
提交回复
热议问题