You should use newValue in the willSet block, and oldValue in the didSet block
Example:
class foo {
var row: String? {
willSet {
println("will set value:")
println(newValue)
}
didSet {
println("did change value:")
println(oldValue)
}
}
}
var bar = foo()
println("First time setter called")
bar.row = "First value"
println("Second time setter called")
bar.row = "Second value"
conclusion:
First time setter called
will set value:
First value
did change value:
nil
Second time setter called
will set value:
Second value
did change value:
First value