CocoaPods trunk is moving to be read-only. Read more on the blog, there are 14 months to go.
| TestsTested | ✗ | 
| LangLanguage | SwiftSwift | 
| License | MIT | 
| ReleasedLast Release | Oct 2016 | 
| SPMSupports SPM | ✓ | 
Maintained by Mohamed Afifi.
Supports Swift 3.0
Have you ever wondered if you can implement a generic key-value observing for Swift. It makes your life easy and saves you a lot of casting. This project is inspired by facebook/KVOController. So, it doesn’t only provide a neat API for KVO’, but also makes use of Swift generics feature.
Simple use
observe(retainedObservable: clock, keyPath: "date", options: .New | .Initial)
    { [weak self] (observable: Clock, change: ChangeData<NSDate>) -> () in
        if let date = change.newValue {
            self?.timeLabel.text = formatter.stringFromDate(date)
        }
}Note, you have to give the change a generic type of the property. In our case property is NSDate, so change is of type ChangeData<NSDate>
You can make use of automatic unobserving behavior or if you really want to unobserve, simply call
  unobserve(clock, keyPath: "date")KVOController-Swift is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "KVOController-Swift"For iOS 7.x:
Embedded frameworks require a minimum deployment target of iOS 8.
To use KVOController-Swift with a project targeting iOS 7, you must include KVOController.swift directly into your project.
Mohamed Afifi, [email protected]
KVOController-Swift is available under the MIT license. See the LICENSE file for more info.