SWIFT - KVO in xcode 6 beta 6 .. observValueForKeyPath is no longer called
I have been debugging my app from beta 3 to beta 6
I can't seem to get watchValueForKeyPath to be called .. I set a breakpoint at the top of the function and nothing happens
self.gameScene.viewController.joystick.addObserver(self, forKeyPath: "relativePosition", options: .New, context: nil)
override func observeValueForKeyPath(keyPath: String!, ofObject object: AnyObject!, change: [NSObject : AnyObject]!, context: UnsafeMutablePointer<Void>) {
if keyPath == "relativePosition" {
// some code here
}
}
this code worked flawlessly before .. something changed? I can't even get this to work in a more basic application .. is there something else I need to do?
+3
source to share