TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Mar 2016 |
Maintained by renzifeng.
每个应用都有设置页面,所以把设置页面封装了一下,可以加快开发效率,简单实用。
__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);
};
ZFSettingGroup *group = [[ZFSettingGroup alloc] init];
group.header = @"高级设置";
group.footer = @"这是footer";
group.items = @[ help, share , about];
[_allGroups addObject:group];