CocoaPods trunk is moving to be read-only. Read more on the blog, there are 19 months to go.

SwiftKVO 1.0.0

SwiftKVO 1.0.0

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Sep 2016
SPMSupports SPM

Maintained by Jake.



SwiftKVO 1.0.0

  • By
  • Jake00

SwiftKVO

Usage

let observer = PropertyObserver(observed: <#NSObject#>, events: <#[String : (AnyObject?, AnyObject?) -> Void]#>, isInitiallyObserving: <#Bool#>)

Example

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
    ])

Requirements

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.

Installation

Manually

Just copy and paste the single class file, PropertyObserver.swift into your project!

Author

Jake00, [email protected]

License

SwiftKVO is available under the MIT license. See the LICENSE file for more info.