Skip to content

Jake00/SwiftKVO

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SwiftKVO

CI Status Version License Platform

Usage

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

Example

func scrollViewContentOffsetDidChange(old: Any?, new: Any?) {
    if let contentOffset = (new as? NSValue)?.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, Jakeyrox@gmail.com

License

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

About

Key-Value Observing for pure Swift objects.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors