https://github.com/CEWendel/SWTableViewCell
我希望当我点击(而不是拖动)表格单元格时,SWTableViewCell的RightUtilityButton会直接显示。
SWTableViewCell似乎没有提供此接口
答案 0 :(得分:2)
调用showRightUtilityButtonsAnimated:
方法。我正在使用示例代码.Replace didSelectRowAtIndexPath
并将UMTableViewCell
更改为YourCellClassName
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSLog(@"cell selected at index path %ld:%ld", (long)indexPath.section, (long)indexPath.row);
NSLog(@"selected cell index path is %@", [self.tableView indexPathForSelectedRow]);
if (!tableView.isEditing) {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
//if you want to hide other cell which are opened first
for (UMTableViewCell *cell in [tableView visibleCells]) {
[cell hideUtilityButtonsAnimated:YES];
}
UMTableViewCell *cell = (UMTableViewCell *)[tableView cellForRowAtIndexPath:indexPath];
[cell showRightUtilityButtonsAnimated:YES];
}