Swift 4 approach for observeValue(forKeyPath:…)
问题 I've been trying to find an example, but what I've seen doesn't work in my case. What would be the equivalent of the following code: object.addObserver(self, forKeyPath: "keyPath", options: [.new], context: nil) override public func observeValue( forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) { } The code above works, but I get a warning from SwiftLink: Prefer the new block based KVO API with keypaths when using Swift 3.2