Coder Social home page Coder Social logo

extensionobjc's Introduction

CaamDauObjC (Swift 版本在这里

CI Status Version License Platform

》目前更多关注于Swift版本,OC版本剩余组件暂不整理更新

pod 'CaamDauExtensionObjC'

CaauDau核心组件

Form流式模型化排版组件

  • 将 delegate、dataSource 设置为 CD_FormTableViewDelegateDataSource
  • 当然也可设置为 self ,只需将 CD_FormTableViewDelegateDataSource 内的方法完全复制过来,而不需要做任何更改
- (VM_TableViewForm *)vm {
    if (!_vm) {
        _vm = [VM_TableViewForm new];
    }
    return _vm;
}
- (void)viewDidLoad {
    [super viewDidLoad];

    self.delegateData = [[CD_FormTableViewDelegateDataSource alloc] initWithForm:self.vm];
    self.tableView.delegate = self.delegateData;
    self.tableView.dataSource = self.delegateData;
    [self.delegateData makeTableView:self.tableView];
    
    __weak typeof(self) weakSelf = self;
    [self.tableView cd_headerAddMJRefresh:^{
        __strong typeof(weakSelf) strongSelf = weakSelf;
        [strongSelf.vm requestData:YES];
        [strongSelf.tableView cd_endRefreshing];
    }];
    [self.tableView cd_beginRefreshing];
}
  • 构建单元格模型:将多点关系的 delegate dataSource 现在转化为单点关系的 模型单元
    {// 将多点关系的 delegate dataSource 现在转化为单点关系的 模型单元
        CD_Row *row = [CD_Row rowWithViewClass:[Cell_TableViewXib class] then:^(CD_Row * _Nonnull obj) {
            obj.viewData = @"Cell_TableViewXib";
            obj.config = [UIColor orangeColor];
            obj.height = 60;
            obj.bundleFrom = @"Home";
        }];
        row.callback = ^(id  _Nonnull any) {
            NSLog(@"点击了 %@ Button", any);
        };
        [f addObject:row];
    }
    [self.forms addObject:f];
    
    if (self.reloadData) {
        self.reloadData();
    }

Chain链式调用组件

UIAlertController.cd_alert
    .cd_title(@"提示")
    .cd_actionCustom(^(UIAlertAction * a){
        a.cd_text(@"以后再说").cd_textColor(color_Txt_3());
    })
    .cd_actionCustom(^(UIAlertAction * a){
        a.cd_text(@"给个好评")
         .cd_textColor(color_Main_1())
         .cd_handler(^(UIAlertAction * b){
            .....
        });
    })
    .cd_show();

Categories便利性扩展

Author

License

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

extensionobjc's People

Watchers

James Cloos avatar

Forkers

wy625571185

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.