1、引入我封裝好的設(shè)置文件? https://github.com/974794055/CGXSetting.git? 將CGXSettingViewController文件夾拖入到項(xiàng)目? ? 引入#import "CGXSettingConst.h"
2、設(shè)置數(shù)據(jù)源
self.sectionArray 數(shù)組存儲(chǔ)的是幾個(gè)分區(qū)的數(shù)據(jù)?? 根據(jù)需要自己添加model數(shù)據(jù)

3、設(shè)置相關(guān)代理


4、開關(guān)按鈕設(shè)置?
在- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
方法中在需要的cell上 加入
model.accessoryType = XBSettingAccessoryTypeSwitch;
model.switchValueChanged = ^(BOOL isOn){
NSLog(@"推送提醒開關(guān)狀態(tài)===%@",isOn?@"open":@"close");
};