Latest 1.0.0
Homepage https://github.com/Jake00/SwiftKVO
License MIT
Platforms ios 8.0, requires ARC
Authors

CI Status
Version
License
Platform

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

CocoaPods

SwiftKVO is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'SwiftKVO'

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.

Latest podspec

{
    "name": "SwiftKVO",
    "version": "1.0.0",
    "summary": "Key-Value Observing for pure Swift objects.",
    "description": "A simple wrapper around Apple's Key-Value Observing API which enables pure Swift objects to participate in KVO updates from NSObject.nAlso allows separate functions called for separate property updates, instead of everything being piped through observeValueForKeyPath:ofObject:.",
    "homepage": "https://github.com/Jake00/SwiftKVO",
    "license": "MIT",
    "authors": {
        "Jake00": "[email protected]"
    },
    "source": {
        "git": "https://github.com/Jake00/SwiftKVO.git",
        "tag": "1.0.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*"
}

Pin It on Pinterest

Share This