ios - Disable delete but enable move cells in UITableView -
i'm aware of 2 methods
- (bool)tableview:(uitableview *)tableview caneditrowatindexpath:(nsindexpath *)indexpath { return indexpath.section == 0; } - (bool)tableview:(uitableview *)tableview canmoverowatindexpath:(nsindexpath *)indexpath { return yes; }
but how can disable delete enable move cells in uitableview?
try adding below delegate methods code.
- (uitableviewcelleditingstyle)tableview:(uitableview *)tableview editingstyleforrowatindexpath:(nsindexpath *)indexpath{ return uitableviewcelleditingstylenone; } - (bool)tableview:(uitableview *)tableview shouldindentwhileeditingrowatindexpath:(nsindexpath *)indexpath { return no; }
Comments
Post a Comment