Created
June 4, 2014 21:39
-
-
Save RyanCopley/b09b2288b8be26357c96 to your computer and use it in GitHub Desktop.
This file contains 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 StepCounter { | |
var totalSteps: Int = 0 { | |
willSet(newTotalSteps) { | |
println("About to set totalSteps to \(newTotalSteps)") | |
} | |
didSet { | |
if totalSteps > oldValue { | |
println("Added \(totalSteps - oldValue) steps") | |
} | |
} | |
} | |
}” | |
Excerpt From: Apple Inc. “The Swift Programming Language.” iBooks. https://itun.es/us/jEUH0.l |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment