CBTableViewDataSource icon indicating copy to clipboard operation
CBTableViewDataSource copied to clipboard

cell的点击事件,怎么使用

Open Xiahaiquan opened this issue 8 years ago • 2 comments

你好,问一哈,cell的点击事件,怎么使用,多谢

Xiahaiquan avatar Jul 03 '16 11:07 Xiahaiquan

可以使用event设置点击事件,如下:

section.event(^(NSUInteger index,id row) {
    CustomViewController * controller = [CustomViewController new];
    controller.viewModel.data = row;
    [self.navigationController pushViewController:controller animated:YES];
});

需要注意的是,event是针对section的,参数index表示点击的cell在该section下的下标,而row表示当前下标的数据。

cocbin avatar Jul 05 '16 01:07 cocbin

Xiahaiquan avatar Jul 05 '16 13:07 Xiahaiquan