Latest 1.0.4
Homepage https://github.com/wangziwu/ZWCommonTableDemo
License MIT
Platforms ios 8.0, requires ARC
Frameworks UIKit
Authors

ZWCommonTableDemo

Version
License
Platform
Language

简介

  • An easy way to build CommontableController.

详细介绍参考我的简书

http://www.jianshu.com/p/bb172ecf68fe

框架整体介绍

  • 该框架为一个通用Table页面展示的框架,旨在提供一种简单table页面规范书写的模板。
  • 1.支持普通tableView界面.
  • 2.支持tableView中cell自定义.
  • 4.框架支持默认点击cell,push到自定义的Controller中.也可拦截p点击事件,执行到自定义方法中.

框架使用方法

  • 直接把ZWCommonTable文件夹拖入到您的工程中.

    #import "ZWCommonTable.h"
  • Cocoapods安装

    pod search ZWCommonTable
    pod 'ZWCommonTable',      '~> 1.0.0'
    #import <ZWCommonTable/ZWCommonTable.h>

    如果发现pod search ZWCommonTable,然后执行pod repo update –verbose命令更新本地spec缓存(可能需要几分钟),然后再搜索就可以了.

代码解析

配置UITableView的协议转发.


-(void)setupTableView{
    __weak typeof(self) weakSelf = self;
    _comDelegate = [[ZWCommonTableDelegate alloc] initWithTableData:^NSArray *{
        return weakSelf.dataSourceArr;
    }];
    self.mTable.tableFooterView = [UIView new];
    self.mTable.tableHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.mTable.frame.size.width, CGFLOAT_MIN)];
    self.mTable.backgroundColor = [UIColor groupTableViewBackgroundColor];
    self.mTable.delegate = _comDelegate;
    self.mTable.dataSource = _comDelegate;
    [self.view addSubview:self.mTable];
}
-(void)setData{
    self.dataSourceArr = @[
                           @{
                               SectionHeaderTitle    :@"",
                               SectionHeaderHeight   :@"",
                               SectionFooterTitle    :@"",
                               SectionFooterHeight   :@"",
                               SectionRows           :@[
                                       @{
                                           CellTitle           :@"微信-事例一",
                                           CellPushVcClassName :@"WeChatMineCtr"
                                           },
                                       @{
                                           CellTitle           :@"微信_事例二",
                                           CellPushVcClassName :@"WeChatSettingCtr"
                                           },
                                       @{
                                           CellTitle           :@"通用",
                                           CellImageName       :@"icon_profile_depart",
                                           CellPushVcClassName :@"CommonTableCtr"
                                           }
                                       ]
                               },
                           ];
    self.dataSourceArr = [ZWCommonTableSection sectionsWithData:self.dataSourceArr];
}

Latest podspec

{
    "name": "ZWCommonTable",
    "version": "1.0.4",
    "summary": "u66f4u7b80u6d01u3001u5febu901fu7684u5b9eu73b0u9759u6001TableViewu9875u9762u3001JSONu5f0fu5199u6cd5u8ba9u4f60u968fu610fu589eu3001u5220u3001u6539u9759u6001cell.",
    "homepage": "https://github.com/wangziwu/ZWCommonTableDemo",
    "license": "MIT",
    "authors": {
        "wangziwu": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/wangziwu/ZWCommonTableDemo.git",
        "tag": "1.0.4"
    },
    "requires_arc": true,
    "source_files": "ZWCommonTable/ZWCommonTable.h",
    "resources": "ZWCommonTable/**/*.{png,xib,nib,bundle}",
    "frameworks": "UIKit",
    "subspecs": [
        {
            "name": "ZWCore",
            "source_files": "ZWCommonTable/ZWCore/*.{h,m}",
            "dependencies": {
                "ZWCommonTable/Protocol": []
            }
        },
        {
            "name": "Protocol",
            "source_files": "ZWCommonTable/Protocol/*.h"
        },
        {
            "name": "ZWStaticCell",
            "source_files": "ZWCommonTable/ZWStaticCell/*.{h,m}",
            "dependencies": {
                "ZWCommonTable/Protocol": [],
                "ZWCommonTable/ZWCore": [],
                "ZWCommonTable/ZWStaticModel": []
            }
        },
        {
            "name": "ZWStaticModel",
            "source_files": "ZWCommonTable/ZWStaticModel/*.{h,m}",
            "dependencies": {
                "ZWCommonTable/Protocol": []
            }
        }
    ]
}

Pin It on Pinterest

Share This