I have a UITableView that I'd like to always show the reorder control, never show the little delete circle icon, and always allow for a swipe delete. Is this possible?
So far, I've only discovered two options:
Thanks for reading
To do this I combined two open source projects into:
https://github.com/adamraudonis/UITableViewCell-Swipe-for-Options
Hope that helps! Currently you can reorder by long-pressing anywhere in the TableViewCell and swipe to delete without showing the red circle.
Apparently UITableView
has a private api method to do just that:
if ([self.tableView respondsToSelector:@selector(_setAllowsReorderingWhenNotEditing:)]) {
[self.tableView _setAllowsReorderingWhenNotEditing:YES];
} else {
// do not ignore this branch
}
Works in iOS 8, 9 and current betas. However, it is your responsibility to check for method availability to avoid crashes. Still would be better than using some overloaded 3rd party library (which most probably will break in future iOS releases).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With