Replace raw Apple KVO observation in an iOS app with block-based callbacks to reduce boilerplate and avoid crash-prone manual observer removal.
Safely observe a model object's properties from a view controller and have all observations cleaned up automatically when the view controller is deallocated.
Add thread-safe property observation to a Swift app by using KVOController with NSObject-inheriting classes and dynamic property annotations.
Project is archived, no further updates. Add via CocoaPods with `pod 'KVOController'`.
KVOController is an Objective-C library originally built at Facebook that makes it easier and safer to watch for changes on iOS and macOS apps. It is now archived, meaning it receives no further updates, but the code is still available and usable. The problem it solves is about a built-in Apple pattern called key-value observing, which lets one part of an app automatically react when a property on another object changes, such as a clock view updating itself whenever a clock object's date property changes. Apple's original implementation of this pattern is known for being tricky: forgetting to remove an observer at the right time can crash the app, and using it across multiple threads has historically caused bugs. KVOController wraps that built-in system with a friendlier interface that handles these edge cases automatically. The main improvements are: you can use block callbacks instead of writing a separate method for every observation, the library never throws an exception when you remove an observer, and when the controller object itself is deallocated, all observations are cleaned up automatically without any extra code from you. It also includes thread-safety protections around a specific Apple bug related to observer cleanup. KVOController works in both Objective-C and Swift. For Swift there are two small requirements: the observing class must inherit from NSObject, and the property being watched must be marked as dynamic. The library works on iOS 6 and later, and OS X 10.7 and later. Installation is available through CocoaPods (add pod 'KVOController' to your Podfile), through Carthage, or by manually dragging two source files into your Xcode project. The project is released under a BSD license.
← facebookarchive on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.