swift uitableview 多选

来源:互联网 发布:linux rpm 查询 编辑:程序博客网 时间:2024/05/16 15:42

oc的方法关键delegate方法是 :

- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath{    return UITableViewCellEditingStyleDelete|UITableViewCellEditingStyleInsert;}

但是swift不能直接使用这种:

swift的方法:

func tableView(tableView: UITableView, editingStyleForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCellEditingStyle {    return UITableViewCellEditingStyle.init(rawValue: UITableViewCellEditingStyle.Insert.rawValue | UITableViewCellEditingStyle.Delete.rawValue)!;}

0 0
原创粉丝点击