Protocols properties requirements in Swift
Forums:
protocol Car {
var engineVolume: Int { get set }
var name: String { get }
}
class Airwave: Car {
var engineVolume: Int = 1500
var name: String {
return "Honda Airwave"
}
}
- Log in to post comments