设置类框架用法
来源:互联网 发布:白金数据观后感 编辑:程序博客网 时间:2024/05/29 17:24
//继承 ILBaseSettingViewController 类
创建三种类型的单元格
一.箭头
ILSettingArrowItem *push = [ILSettingArrowItem itemWithIcon:@"1" title:@"通用"];
//需要写出来子标题的:
push.subtitle=@"nihao";
//需要push到ILPushNoticeViewController控制器中。 需要写出来---》
push.showVCClass = [ILPushNoticeViewController class];
二.开关
ILSettingSwitchItem *LocationServices = [ILSettingSwitchItem itemWithIcon:@"10" title:@"KVO来实现"];
//保留全局变量
_LocationServices = LocationServices;
//开关必有key来持久化数据
_LocationServices.key = ILSettingShakeChoose;
//1.观察LocationServices中的off属性值
[_LocationServices addObserver:self forKeyPath:@"off" options:NSKeyValueObservingOptionNew context:nil];
//2.观察者响应方法
-(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSString *,id> *)change context:(void *)context
{
if(_LocationServices.off == YES){
NSLog(@"上面关");
}else{
NSLog(@"上面开");
}
if (_SystemServices.off == YES) {
NSLog(@"下面关");
}else
{
NSLog(@"下面开");
}
}
//3.移除观察者
-(void)dealloc
{
[_LocationServices removeObserver:self forKeyPath:@"off"];
[_SystemServices removeObserver:self forKeyPath:@"off"];
}
三.左字右字的
创建三种类型的单元格
一.箭头
ILSettingArrowItem *push = [ILSettingArrowItem itemWithIcon:@"1" title:@"通用"];
//需要写出来子标题的:
push.subtitle=@"nihao";
//需要push到ILPushNoticeViewController控制器中。 需要写出来---》
push.showVCClass = [ILPushNoticeViewController class];
二.开关
ILSettingSwitchItem *LocationServices = [ILSettingSwitchItem itemWithIcon:@"10" title:@"KVO来实现"];
//保留全局变量
_LocationServices = LocationServices;
//开关必有key来持久化数据
_LocationServices.key = ILSettingShakeChoose;
//1.观察LocationServices中的off属性值
[_LocationServices addObserver:self forKeyPath:@"off" options:NSKeyValueObservingOptionNew context:nil];
//2.观察者响应方法
-(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSString *,id> *)change context:(void *)context
{
if(_LocationServices.off == YES){
NSLog(@"上面关");
}else{
NSLog(@"上面开");
}
if (_SystemServices.off == YES) {
NSLog(@"下面关");
}else
{
NSLog(@"下面开");
}
}
//3.移除观察者
-(void)dealloc
{
[_LocationServices removeObserver:self forKeyPath:@"off"];
[_SystemServices removeObserver:self forKeyPath:@"off"];
}
三.左字右字的
ILSettingLabelItem *endTime = [ILSettingLabelItemitemWithTitle:@"结束时间"];
// endTime.text = @"23:59";
endTime.key =ILSettingScoreShowEndTime;
if (endTime.text.length ==0) {
endTime.text =@"23:59";
}
ILSettingGroup *endTimeGroup = [[ILSettingGroupalloc] init];
endTimeGroup .items =@[endTime];
[_allGroupsaddObject:endTimeGroup];
1 0
- 设置类框架用法
- 集合类框架用法小结
- 框架设置
- 类集框架之ArrayList简单用法
- 类集框架之Set简单用法
- 类集框架之Map简单用法
- EF框架用法
- DWR框架基本用法
- 框架frameset用法
- Jquery 验证框架用法
- SiteMesh框架的用法。。。。。
- 集合框架的用法 。
- ajax框架dwr用法
- JACKSON框架用法基本
- Xutils框架用法
- iframe框架用法
- ORMLite框架入门用法
- 异步HttpClient框架用法
- Linux内核---12.S3C6410平台中SD启动详细分析
- 使用 RMI + ZooKeeper 实现远程调用框架
- Linux内核---13.启动分析1之arch/arm/kernel/head.S
- Android studio 依赖可运行项目
- eclipse 安装svn插件
- 设置类框架用法
- AndroidOpenCV配置与SimpleDemo
- Linux内核---14.启动分析2之arch/arm/kernel/head.S
- 深入浅出SOA思想
- Linux内核---15.启动分析3之arch/arm/kernel/head.S
- java基础/StringbBuffer/StringBuilder
- 微服务、SOA 和 API对比与分析
- WDCP_PHP降级至5.2.17
- loadRunner12 设置关联 获取服务端动态数据