https://github.com/jakemarsh/JMStaticContentTableViewController
簡單易用
- (id) init {
self = [super initWithStyle:UITableViewStyleGrouped];
if (!self) return nil;
return self;
}
- (void)viewDidLoad {
[super viewDidLoad];
//設定頁面表格顯示
[self addSection:^(JMStaticContentTableViewSection *section, NSUInteger sectionIndex) {
[section addCell:^(JMStaticContentTableViewCell *staticContentCell, UITableViewCell *cell, NSIndexPath *indexPath) {
staticContentCell.reuseIdentifier = @"UIControlCell";
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.textLabel.text = NSLocalizedString(@"是否接收推送", @"是否接收推送");
cell.accessoryView = openSwitch;
}];
[section addCell:^(JMStaticContentTableViewCell *staticContentCell, UITableViewCell *cell, NSIndexPath *indexPath) {
staticContentCell.reuseIdentifier = @"UIControlCell1";
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.textLabel.text = NSLocalizedString(@"關注分類", @"關注分類");
cell.accessoryView=image;
} whenSelected:^(NSIndexPath *indexPath) {
//TODO
// [self fenleiChanged:showFenlei];
}];
}];
}