CocoaPods trunk is moving to be read-only. Read more on the blog, there are 18 months to go.
TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Aug 2016 |
Maintained by Halin.
这是一个参考自Android DataBinding (http://developer.android.com/tools/data-binding/guide.html) 的库,其用法与Android 的 DataBinding非常相似 通过 xib 的 User Defined Runtime Attributes 实现对model的绑定(类似于Android xml 的 binding),设置绑定模型与绑定方法,
This is a lib base on 'Android DataBinding' (http://developer.android.com/tools/data-binding/guide.html) , It use like Android DataBinding , You can bind model and method through 'User Defined Runtime Attributes'
Forgive my poor English , There is no English Document and Notes , but if you interested ,just send me a Email,i will tell you how to use and how it work . and hopely you can help me to write English document and notes... My Email address : [email protected]
To run the example project, clone the repo, and run pod install
from the Example directory first.
#import <DataBindingLib/DataBindingLib.h>
@implementation ExampleModel
- (void)dealloc{
[[DataBindingUtil dataBindingUtil] unbindModel:self];
}
@end
KeyPath | Value | 说明
----------------------------------------------------
BindType | ExampleModel | 对应绑定model的名称如:Example Model
BindMethod:string | setText: | BindMethod: 对应监听的Property名称,及当property改变后调用的方法 此处将监听string 这个 property setText:当string改变后,以string的值为参数调用setText:这个方法
_exampleModel = [[ExampleModel alloc] init];
[[DataBindingUtil dataBindingUtil] bindModel:_exampleModel forView:self.view];
_exampleModel.string = @"Test Start";
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
_exampleModel.string = @"String has been changer by binder";
});
DataBindingLib is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "DataBindingLib"
Halin, [email protected]
DataBindingLib is available under the MIT license. See the LICENSE file for more info.-Warc-performSelector-leaks