ややてこずったので、世界平和のために軌跡を残します。
override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
if (keyPath == "contentOffset") {
if let value = change?[NSKeyValueChangeKey.newKey] as? NSValue {
let contentOffset = value.cgPointValue
// あとは煮るなり焼くなり
}
}
}
前はNSNumber -> CGPointValueで取れてたんですが、NSValueじゃないとだめになったようです。