Skip to content

zhugexiaobo/MCSettingsCell

Repository files navigation

MCSettingsCell

Build Status Version License Platform

快速创建常用设置页面元素。

Example

// 创建单元格模型
MCSettingsItem *item = [[MCSettingsItem alloc] initWithTitle:@"Style 3" detail:@"detail"];
item.subtitleString = @"subtitle";
item1.leftImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"image"]];
item.hintBtn = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
item.settingItemClicked = ^(MCSettingsItem * _Nonnull item) {
    // 点击事件
};

// 加入数据源
_dataSource = @[item];


// tableview delegate
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    MCSettingsCell *cell = [tableView dequeueReusableCellWithIdentifier:MCSettingsCellID];
    cell.item = _dataSource[indexPath.row];
    return cell;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return _dataSource.count;
}

Installation

MCSettingsCell is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'MCSettingsCell'

License

MCSettingsCell is available under the MIT license. See the LICENSE file for more info.

About

Easy to create common types of setting table cell

Resources

License

Stars

Watchers

Forks

Packages

No packages published