I'm trying to add a property observer in my class ChooserListVC for "list"
These are the variables in ChooserSaves that I would like to track.
class ChooserSaves: UIDocument {
var savedListObject : SavedList?
var listName : String = ""
var chooserItems : [String] = []
}
Im not sure how to set this up in the class I'm implementing it.
class ChooserListVC: UIViewController, UITableViewDelegate, UITableViewDataSource,UITextFieldDelegate{
var list : ChooserSaves!
I tried to do something like this:
var list : ChooserSaves!{
didSet{
if chooserItems.count > 0{
println("didset greater than 1")
}
else{
println("didset less than 1")
}
}
}
But this only works once when the segue assigns the list. How can I make it so that every time I change list.chooserItems
in other bits of code, it would trigger the correct line?