- Get link
- Other Apps
This post is about how to execute a function when a variable value changes.
Instead of key-value observation, simply use a property observer for the variable.
For e.g:
Whenever the value of variable named allSlot changes, the two lines will execute which are written in the didSet method.
private var allSlot: [String] = [] {
didSet {
slotTableView?.reloadData()
enableRightBarButton()
}
}
Comments
Post a Comment