I am trying to use KVO in Swift, but the "observValueForKeyPath" method is called once.
Here is the gist of my code
I tried using NSNumber instead of Int , add all parameters to addObserver , but the method still calls once when my view loads.
Any idea?
EDIT: It seems I found a workaround using:
var lifes: Int { willSet { willChangeValueForKey("lifes") } }
source share