TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Sep 2015 |
Maintained by Erik Johansson.
DragAndDropTableView is a UITableView which supports drag and drop reordering of table cells.
DragAndDropTableView operates the same way your standard UITableView does except for a few added protocols.
@protocol DragAndDropTableViewDataSource <NSObject>
@optional
-(BOOL)canCreateNewSection:(NSInteger)section;
@end
@protocol DragAndDropTableViewDelegate <NSObject>
@optional
-(void)tableView:(DragAndDropTableView *)tableView willBeginDraggingCellAtIndexPath:(NSIndexPath *)indexPath placeholderImageView:(UIImageView *)placeHolderImageView;
-(void)tableView:(DragAndDropTableView *)tableView didEndDraggingCellAtIndexPath:(NSIndexPath *)sourceIndexPath toIndexPath:(NSIndexPath *)toIndexPath placeHolderView:(UIImageView *)placeholderImageView;
-(CGFloat)tableView:(DragAndDropTableView *)tableView heightForEmptySection:(int)section;
@end
As you can see all methods are optional. If you choose to implement the protocols the UITableViewDataSource used by your table should implement the DragAndDropTableViewDataSource protocol and your UITableViewDelegate should implement the DragAndDropTableViewDelegate protocol.
See the example project for further help.
If you are using DragAndDropTableView I would love to hear about it. Send me a ping on Twitter
DragAndDropTableView is available under the MIT license. See the LICENSE file for more info.