🅿️protocol
🚧 施工中
Swift ⟩ type ⟩ category ⟩ protocol
A set of requirements, such as methods and properties, that can be adopted (or followed) by a type, such as a class, structure, or enumeration.
When a type adopts a protocol, it provides its own implementation of the protocol requirements, and is said to conform to that protocol.
🇹🇼 中文稱為「規範」或「協定」。
protocol is a declaration.
Protocol Requirements:
methods
initializers
associated types
properties
inherited protocols
5 Stars ⟩ Every SwiftUI protocol explained
weak self podcast ⟩ 2: Swift API 設計之原來我不會用 protocol
Swift ⟩ Protocols
Last updated
Was this helpful?