Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
除了 AnyObject 可以表示任何类类型的实例之外,Swift 文档中没有任何内容特别提到这一点。Swift 中的所有类类型都隐式实现 AnyObject 协议吗?
class C {} // Is this implicitly class C: AnyObject {}? let c = C() let anyC: AnyObject = c // ok
从文档中:
任何对象 所有类都隐式遵循的协议。
所有类都隐式遵循的协议。