TestsTested | ✓ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Sep 2016 |
SPMSupports SPM | ✗ |
Maintained by Jake.
let observer = PropertyObserver(observed: <#NSObject#>, events: <#[String : (AnyObject?, AnyObject?) -> Void]#>, isInitiallyObserving: <#Bool#>)
func scrollViewContentOffsetDidChange(oldValue: AnyObject?, newValue: AnyObject?) {
if let contentOffset = newValue?.CGPointValue() {
// Do something with the new content offset...
}
}
let observer = PropertyObserver(observed: self.scrollView, events: [
"contentOffset": scrollViewContentOffsetDidChange
])
If installing using CocoaPods, then a deployment target of iOS 8 or higher is required due to dynamic framework linking.
If you prefer to install manually then the minimum deployment target is loosened to iOS 7 or higher due to Swift not being available for iOS 6 and below.
Just copy and paste the single class file, PropertyObserver.swift into your project!
Jake00, [email protected]
SwiftKVO is available under the MIT license. See the LICENSE file for more info.