Skip to content

Instantly share code, notes, and snippets.

@eduardo22i
Last active April 8, 2018 19:13
Show Gist options
  • Save eduardo22i/3031bb50615320076e9a09b08a5fc6c6 to your computer and use it in GitHub Desktop.
Save eduardo22i/3031bb50615320076e9a09b08a5fc6c6 to your computer and use it in GitHub Desktop.
protocol Vehicle {
var currentSpeed : Double { get }
func accelerate()
func decelerate()
}
extension Vehicle {
var isMoving : Bool { get { return currentSpeed != 0 } }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment