Latest 0.0.1
Homepage https://github.com/renzifeng/ZFSetting
License MIT
Platforms ios 7.0, requires ARC
Authors

Build Status
Cocoapods Compatible
Build Status
Build Status

每个应用都有设置页面,所以把设置页面封装了一下,可以加快开发效率,简单实用。

效果演示:

image

Installation with CocoaPods

pod 'ZFSetting'

How To Use

直接继承ZFBaseSettingViewController,创建UIViewController的类,实现以下方法就可以实现设置页面的显示。

__weak typeof(self) weakSelf = self;
// 初始化Item
ZFSettingItem *help = [ZFSettingItem itemWithIcon:@"MoreHelp" title:@"帮助" type:ZFSettingItemTypeArrow];
//cell点击事件的block回调
help.operation = ^{
    UIViewController *helpVC = [[UIViewController alloc] init];
    helpVC.view.backgroundColor = [UIColor grayColor];
    helpVC.title = @"帮助";
    [weakSelf.navigationController pushViewController:helpVC animated:YES];
};
ZFSettingItem *shake = [ZFSettingItem itemWithIcon:@"sound_Effect" title:@"声音提示" type:ZFSettingItemTypeSwitch];
//开关事件
shake.switchBlock = ^(BOOL on) {
    NSLog(@"声音提示%zd",on);
};

cell的设置

ZFSettingGroup *group = [[ZFSettingGroup alloc] init];
group.header = @"高级设置";
group.footer = @"这是footer";
group.items = @[ help, share , about];
[_allGroups addObject:group];

有技术问题也可以加我的iOS技术群,互相讨论,群号为:213376937

期待

  • 如果在使用过程中遇到BUG,或发现功能不够用,希望你能Issues我者微博联系我@任子丰
  • 如果觉得好用请Star!

Latest podspec

{
    "name": "ZFSetting",
    "version": "0.0.1",
    "summary": "An easy setting",
    "homepage": "https://github.com/renzifeng/ZFSetting",
    "license": "MIT",
    "authors": {
        "renzifeng": "[email protected]"
    },
    "source": {
        "git": "https://github.com/renzifeng/ZFSetting.git",
        "tag": "0.0.1"
    },
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "ZFSetting/**/*.{h,m}"
}

Pin It on Pinterest

Share This