inspiration by https://github.com/jspahrsummers/libextobjc
SafeKeyPath is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'SafeKeyPath'
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);
iOSleep, mx.yolande@gmail.com
SafeKeyPath is available under the MIT license. See the LICENSE file for more info.