iPhone Hotness of the Day: Baked-in Drag and Drop of UITableView Cell Items

So you want to add drag-and-drop functionality to the items in a UITableView Cell, eh?

Head over to your app’s equivalent of RootViewController.m and check out all the cool stuff commented-out and at your fingertips.

Somewhere in that file you should see

RootViewController.m
/*
// Override to support rearranging the list
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
}
*/

Go ahead and uncomment that bad boy. Congratulations on your new drag-and-drop interface!

Your previously-boring UITableView that used to look something like this:

Boring UITableView

Boring UITableView

Is now the envy of the whole neighborhood:

UITableView

UITableView

This entry was posted in Code and tagged , , , , , , . Bookmark the permalink. Both comments and trackbacks are currently closed.