When I use [tableview setEditing:YES animated:YES]; To enable reordering of a UITableViewCell, a delete element also appears. How can I prevent this?
[tableview setEditing:YES animated:YES];
Add -tableView:editingStyleForRowAtIndexPath: to the table view delegate and return UITableViewCellEditingStyleNone .
-tableView:editingStyleForRowAtIndexPath:
return UITableViewCellEditingStyleNone
Add this method to youc code:
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { // Return NO if you do not want the specified item to be editable. return NO; }
Source: https://habr.com/ru/post/1390855/More articles:How to use the interface in my code to make it more scalable? - oopIs this behavior undefined in C ++? - c ++How to suppress type type warnings in generated canonical metadata classes? - javaAlphanumeric identifiers and the $ symbol - scalaAndroid action bar: press the Up soft key - androidBeautifulsoup for navigating divs by attribute without findAll - pythonList functions of JavaScript objects? - javascriptForcing Google Sheets to Publish Now - automationSaving history in SQL Server 2008? - c #Can a relative path be used in ProxyPass / ProxyPassReverse? - apacheAll Articles