I have a class as property with a property observer. If I change something in that class, is there a way to trigger didSet as shown in the example:
class Foo {
var items = [1,2,3,4,5]
var number: Int = 0 {
didSet {
items += [number]
}
}
}
var test: Foo = Foo() {
didSet {
println("I want this to be printed after changing number in test")
}
}
test.number = 1 // Nothing happens