美文网首页潮流App#封装库
快速设置我的界面以及设置界面

快速设置我的界面以及设置界面

作者: CGX_鑫 | 来源:发表于2017-08-02 17:13 被阅读0次

    1、引入我封装好的设置文件  https://github.com/974794055/CGXSetting.git  将CGXSettingViewController文件夹拖入到项目    引入#import "CGXSettingConst.h"

    2、设置数据源

    self.sectionArray 数组存储的是几个分区的数据   根据需要自己添加model数据

    3、设置相关代理



    4、开关按钮设置 

    在- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    方法中在需要的cell上 加入

    model.accessoryType = XBSettingAccessoryTypeSwitch;

    model.switchValueChanged = ^(BOOL isOn){

    NSLog(@"推送提醒开关状态===%@",isOn?@"open":@"close");

    };


    相关文章

      网友评论

        本文标题:快速设置我的界面以及设置界面

        本文链接:https://www.haomeiwen.com/subject/dejdtxtx.html