iOSleep/SafeKeyPath

esay to use kvo safely

★ 1Forks 1ShellGitHub ↗Compare

README

CI Status Version License Platform

inspiration by https://github.com/jspahrsummers/libextobjc

Installation

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

pod 'SafeKeyPath'

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

For object you can use like this

UIButtn *btn;
// simple
NSString *keyPath1 = KeyPath(btn, state);
// mulit
NSString *keyPath2 = KeyPath(btn, titleLabel, text);

you can also use Class to get keyPath

// simple
NSString *keyPath1 = KeyPath(btn, state);
// mulit
NSString *keyPath2 = KeyPath(btn, titleLabel, text);

Author

iOSleep, [email protected]

License

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