import Foundation class Person: NSObject { var my = My() let keyName = "level" override init() { super.init() my.addObserver(self, forKeyPath: keyName, options: [.New, .Old], context: nil) my.level += 2 // 1回目の変更 my.level += 7 // 2回目の変更 } deinit { my.removeObserver(self, forKeyPath: keyName) } override func observeValueForKeyPath(keyPath: String?, ofObject object: AnyObject?, change: [String : Any