Latest 0.3.1
Homepage https://github.com/xiaowinner/YXWListBinder
License MIT
Platforms ios 8.0
Dependencies ReactiveObjC
Authors

使用

只需要进行如下步骤:

  • Podfile 中输入 pod ‘YXWListBinder’
  • 移动YXWListBinder文件夹下的所有文件到你的项目.
  • 执行pod install.

注意

0.2.0 依赖的是老版本ReactiveCocoa >= 2.5,
0.3.0 之后依赖最新的ReactiveObjC

提示 :)

  • 该项目依赖于ReactCocoa,请在Podfile中添加 pod ‘ReactiveObjC’.

  • 项目中包含Demo.

  • 根据自己的需求制定自己的YXWListBinderWidgetProtocol 和 YXWListBinderViewModelProtocol

  • Protocol中要有MVVM的绑定机制的方法,如:
/*
Cell
*/
- (void)bindViewModel:(id<YXWListBinderViewModelProtocol>)viewModel atIndexPath:(NSIndexPath *)indexPath;
/*
ViewModel
*/
@required
- (NSString *)identifier;
- (CGFloat)widgetHeight;

@optional
- (NSInteger)gainSubDataCount:(NSInteger)section;
- (id <YXWListBinderViewModelProtocol>)gainSubData:(NSInteger)index;
  • 注意区分以下两个初始化方法:
/*
根据 nib 注册TableView Cell
*/
- (instancetype)initBinder:(UITableView *)tableView
dataCommand:(RACCommand *)dataCommand
hasSection:(BOOL)hasSection
nibsCell:(NSArray *)nibs
identifiers:(NSArray *)identifiers;
/*
根据 Class name 注册TableView Cell
*/
- (instancetype)initBinder:(UITableView *)tableView
dataCommand:(RACCommand *)dataCommand
hasSection:(BOOL)hasSection
cellClassNames:(NSArray *)names
identifiers:(NSArray *)identifiers;
/*
根据 nib 注册CollectionView Item
*/
- (instancetype)initBinder:(UICollectionView *)collectionView
nibsItem:(NSArray *)nibsItem
itemIdentifiers:(NSArray *)itemIdentifiers
dataCommand:(RACCommand *)dataCommand;
/*
根据 Class name 注册CollectionView Item
*/
- (instancetype)initBinder:(UICollectionView *)collectionView
itemClassNames:(NSArray *)itemClassNames
itemIdentifiers:(NSArray *)itemIdentifiers
dataCommand:(RACCommand *)dataCommand;

Latest podspec

{
    "name": "YXWListBinder",
    "version": "0.3.1",
    "summary": "A short description of YXWListBinder.",
    "description": "TODO: Add long description of the pod here.",
    "homepage": "https://github.com/xiaowinner/YXWListBinder",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "u539fu6653u6587": "[email protected]"
    },
    "source": {
        "git": "https://github.com/xiaowinner/YXWListBinder.git",
        "tag": "0.3.1"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "YXWListBinder/Classes/**/*",
    "dependencies": {
        "ReactiveObjC": []
    }
}

Pin It on Pinterest

Share This