All Projects → corderguo → StaticPage

corderguo / StaticPage

Licence: MIT license
静态页面大杀器 ------三行代码搞定常用静态页面

Programming Languages

objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to StaticPage

XTableView
一个基于RecyclerView+Scroller实现的二维表格组件,同时支持侧滑菜单、拖动调整列表顺序等拓展功能。A two-dimensional table view, base on recyclerview, both support to side slide menu、drag item and more.
Stars: ✭ 15 (-62.5%)
Mutual labels:  tableview
SPPickerView
这是一个选择器,功能类似系统的UIPickerView,但是比UIPickerView的适用范围广得多
Stars: ✭ 28 (-30%)
Mutual labels:  tableview
ReactiveDataDisplayManager
No description or website provided.
Stars: ✭ 35 (-12.5%)
Mutual labels:  tableview
ZKTreeTableView
A view of the tree structure.树状结构列表。
Stars: ✭ 97 (+142.5%)
Mutual labels:  tableview
DLStretchableTableHeaderView
TableView with strechable header
Stars: ✭ 17 (-57.5%)
Mutual labels:  tableview
Alister
No more boilerplate code with tables and collections!
Stars: ✭ 15 (-62.5%)
Mutual labels:  tableview
Reactivelists
React-like API for UITableView & UICollectionView
Stars: ✭ 250 (+525%)
Mutual labels:  tableview
MapTable-Swift
Mimic Find My Friends first screen behavior
Stars: ✭ 69 (+72.5%)
Mutual labels:  tableview
SectionReactor
A ReactorKit extension for managing table view and collection view sections with RxDataSources
Stars: ✭ 45 (+12.5%)
Mutual labels:  tableview
IZJHorizontalTableView
一个支持添加横向滑动切换ScrollView的tableView,并且保持原有垂直方向视图加载的View。可实现仿微博iOS,转转iOS等切换效果
Stars: ✭ 14 (-65%)
Mutual labels:  tableview
StretchableTableViewHeader-Swift
You might have seen a collapsable or stretchable tableview header in android. If you check the whatsapp profile/ group settings page , you can see this. If you are using Netflix app, you might have seen a zoom in effect in the tableview header as well. Well, if you ever wondered how to do this in iOS, I will give a simple solution.
Stars: ✭ 57 (+42.5%)
Mutual labels:  tableview
MultilevelList
TableView多级列表:分级展开或合并,逐级获取并展示其子级数据,可以设置最大的层级数,支持多选、单选、取消选择。
Stars: ✭ 59 (+47.5%)
Mutual labels:  tableview
bppgrid
QtQuick 2 Table component, modeled on TableView QML Type and some other Cool qml components
Stars: ✭ 54 (+35%)
Mutual labels:  tableview
react-native-js-tableview
A JavaScript implementation for TableView that looks great on both iOS and Android.
Stars: ✭ 23 (-42.5%)
Mutual labels:  tableview
TableViewExtension
This extension simplify registering any cell, reusing and other verbosity steps.
Stars: ✭ 13 (-67.5%)
Mutual labels:  tableview
SUBLicenseViewController
✒ CocoaPod for attributing open source software! https://insanj.github.io/SUBLicenseViewController/
Stars: ✭ 15 (-62.5%)
Mutual labels:  tableview
iOSProjects
It's project that contains different applications developed with Swift 5.7 👨‍💻👩🏼‍💻🧑🏿‍💻
Stars: ✭ 122 (+205%)
Mutual labels:  tableview
YYBottomSheet
Simple and Clear BottomSheet
Stars: ✭ 45 (+12.5%)
Mutual labels:  tableview
SplittableViewKit
A cell of IndexPath(row: 0, section: 0) in UITableView is automatically moved to left view when device rotated.
Stars: ✭ 39 (-2.5%)
Mutual labels:  tableview
ZXTableView
快速、高效地构建TableView,节省80%以上重复代码,无需设置数据源和代理。
Stars: ✭ 18 (-55%)
Mutual labels:  tableview

StaticPage

  • 静态页面大杀器,利用该库三行代码就能搞定通用静态页面

如何使用StaticPage

首先先把你控制器中tableview的类型设置为UITableViewStyleGrouped类型

_tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height) style:UITableViewStyleGrouped];

只需要导入ICCommonItemCell.h头文件

import "ICCommonItemCell.h"

然后在你的数据源中根据分组来设置相应的数据,例如demo中的代码:

-(NSMutableArray *)dataArray
{
    if (nil == _dataArray) {
        _dataArray = [NSMutableArray array];
        
        ICCommonItem *friendItem  = [ICSettingArrowItem itemWithIcon:@"ff_IconShowAlbum" title:@"朋友圈" destVcClass:[ICTestViewController class] parameter:@"朋友圈"]; // 根据要跳转的控制器需要的参数类型,具体填写,我这里需要的是字符串类型,就传递的字符串
        ICCommonGroup *friendGroup = [[ICCommonGroup alloc] init];
        friendGroup.items          = @[friendItem];
        
        ICCommonItem *sweepItem    = [ICSettingArrowItem itemWithIcon:@"ff_IconQRCode" title:@"扫一扫" destVcClass:[ICTestViewController class] parameter:@"扫一扫"];
        ICCommonItem *waveItem     = [ICSettingArrowItem itemWithIcon:@"ff_IconShake" title:@"摇一摇" destVcClass:[ICTestViewController class] parameter:@"摇一摇"];
        ICCommonGroup *sewaGroup   = [[ICCommonGroup alloc] init];
        sewaGroup.items            = @[sweepItem,waveItem];
        
        ICCommonItem *nearItem     = [ICSettingArrowItem itemWithIcon:@"ff_IconLocationService" title:@"附近的人" destVcClass:[ICTestViewController class] parameter:@"附近的人"];
        ICCommonItem *driftItem    = [ICSettingArrowItem itemWithIcon:@"ff_IconBottle" title:@"漂流瓶" destVcClass:[ICTestViewController class] parameter:@"漂流瓶"];
        ICCommonGroup *nedrGroup   = [[ICCommonGroup alloc] init];
        nedrGroup.items            = @[nearItem,driftItem];
        
        ICCommonItem *shopItem     = [ICSettingArrowItem itemWithIcon:@"ff_IconQRCode" title:@"购物" destVcClass:[ICTestViewController class] parameter:@"购物"];
        ICCommonItem *gameItem     = [ICSettingArrowItem itemWithIcon:@"MoreGame" title:@"游戏" destVcClass:[ICTestViewController class] parameter:@"游戏"];
        ICCommonGroup *shgaGroup   = [[ICCommonGroup alloc] init];
        shgaGroup.items            = @[shopItem,gameItem];
        
        [_dataArray addObject:friendGroup];
        [_dataArray addObject:sewaGroup];
        [_dataArray addObject:nedrGroup];
        [_dataArray addObject:shgaGroup];
    }
    return _dataArray;
}

其中ICCommonGroup对应一组,而ICCommonItem又对应组中的每一个Item,每个Item有两种类型 ,分别为ICSettingArrowItem和ICSettingSwitchItem;

+ (instancetype)itemWithIcon:(NSString *)icon title:(NSString *)title destVcClass:(Class)destVcClass parameter:(id)parameter;

这个方法中的参数含义:

  • icon:cell中左边图片的图片名
  • title:cell的title显示的字符串内容
  • destVcClass:点击cell时要跳转的控制器类型
  • parameter:点击cell时要跳转时需要传递过去的参数

如果ICCommonItem中存在ICSettingSwitchItem,为了扑捉到UISwitch的开关事件,你需要遵守ICCommonItemCellDelegate,实现其中的代理方法:

- (void)commonItemCell:(ICCommonItemCell *)cell
                 swith:(UISwitch *)swith;

如果想要改变每个组之间的间距(是组不是每个Item)你可以重写tableview的两个代理方法,返回自己想要的间距即可:

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{}

每个Item还可以在其对应的block中响应对应的事件,这样只需在tableview的didSelected方法中调用option这个block即可;

如果你需要显示区头或者区尾,只需要在数据源中给对用的group设置header或footer即可:

 ICCommonItem * discover    = [ICSettingSwitchItem itemWithIcon:nil title:@"置顶会话" destVcClass:nil parameter:nil];
 ICCommonItem *companyDoc   = [ICSettingSwitchItem itemWithIcon:nil title:@"消息免打扰" destVcClass:nil parameter:nil];
ICCommonGroup * mesGroup   = [[ICCommonGroup alloc] init];
mesGroup.header            = @"来个区头玩玩";
mesGroup.items = @[discover,companyDoc];

然后在tableview的代理方法中调用即可:

- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
    ICCommonGroup *group = self.dataArray[section];
    return group.header;
}
- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section
{
    ICCommonGroup *group = self.dataArray[section];
    return group.footer;
}

如果你在使用过程中遇到什么问题您可以issues提问,如果你想贡献代码请pull Reques;

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].