Created
October 5, 2015 22:40
-
-
Save quephird/04c7b1e72ec59d9fb63b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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