the-swift-programming-language-in-chinese
the-swift-programming-language-in-chinese copied to clipboard
更新swift5.9.2 对可选协议的描述
根据Apple 官方文档 https://docs.swift.org/swift-book/documentation/the-swift-programming-language/protocols#Optional-Protocol-Requirements Both the protocol and the optional requirement must be marked with the @objc attribute. Note that @objc protocols can be adopted only by classes, not by structures or enumerations.
可选协议只可以被class 遵守,并不需要class继承NSObject 或者标记@objc.