Skip to content

Instantly share code, notes, and snippets.

@quephird
Created October 5, 2015 22:40
Show Gist options
  • Save quephird/04c7b1e72ec59d9fb63b to your computer and use it in GitHub Desktop.
Save quephird/04c7b1e72ec59d9fb63b to your computer and use it in GitHub Desktop.
class Vehicle {
var color: String?
var maxSpeed = 80 {
willSet(s) {
print("Changing max speed from \(s)...")
}
didSet(s) {
print("to \(s)")
}
}
func description() -> String {
return "A \(self.color) vehicle"
}
func travel() {
print("Traveling at \(maxSpeed) kph")
}
deinit {
print("AAaaaaaaaa!!!!")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment