UITableViewDelegate method tableView:didEndReorderingRowAtIndexPath: should be public API
| Originator: | cflesner | ||
| Number: | rdar://13680523 | Date Originated: | 17-Apr-2013 08:31 PM |
| Status: | Open | Resolved: | |
| Product: | iOS SDK | Product Version: | 6.1 |
| Classification: | Enhancement | Reproducible: | Always |
Summary:
When a UITableView has completed reordering cells it sends the message tableView:didEndReorderingRowAtIndexPath: to its delegate. This is undocumented behavior, and therefore not allowed to be used in production code. It would be very useful if it were documented.
Steps to Reproduce:
In a class that is the delegate of a UITableView, add the following code:
- (void)tableView:(UITableView *)tableView didEndReorderingRowAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"UITableView: %@ Did end reordering row at index path: %@", tableView, indexPath);
}
You will then see the output in the console every time you reorder a cell, even if you put the cell back to the same indexPath it started at.
Expected Results:
The method should be documented, public API so it can be used in an app submitted to the App Store.
Actual Results:
The method is undocumented, private API, and is therefore not allowed in apps submitted to the App Store.
Regression:
Unknown. The method is not listed as deprecated, so I assume it has always been undocumented.
Notes:
Currently, your delegate gets sent the message tableView:moveRowAtIndexPath:toIndexPath: if, and only if, the index path that the cell was placed at is different from its starting index path. If you place it back where it came from, you do not get sent the message and cannot react.
Your delegate also currently gets sent tableView:targetIndexPathForMoveFromRowAtIndexPath:toProposedIndexPath:, but that is sent before the animation is completed (whereas, tableView:didEndReorderingRowAtIndexPath: gets sent after the animation completes). So you may not be able to react appropriately at this time.
One example problem (and my current problem) is having subviews of the tableView. They end up underneath the cells when the cells are reordered. Bringing them to the front in tableView:didEndReorderingRowAtIndexPath: solves the problem, but it is an undocumented, private method :(
Help me, Obi-Wan Kenobi; you're my only hope.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!