Protocol
protocol SomeProtocol {
// protocol definition goes here
}protocol ItemDiscribable {
var description: String { get }
}
protocol Togglable {
mutating func toggle()
}struct SomeStructure: FirstProtocol, AnotherProtocol {
// structure definition goes here
}
enum SomeEnum: FirstProtocol {
// enum definition goes here
}Last updated