DragAndDropTableView 0.1.11

DragAndDropTableView 0.1.11

测试已测试
Lang语言 Obj-CObjective C
许可证 MIT
发布最后发布2015年9月

Erik Johansson维护。



  • 作者
  • Erik Johansson

DragAndDropTableView是一个支持拖放重排序表格单元格的UITableView。

安装

手动

  • 下载源代码并将DragAndDropFolder添加到您的项目中
  • 确保将QuartzCore框架添加到您的项目中
  • 创建一个DragAndDropTable并开始拖放操作

使用

除了添加了几项协议外,DragAndDropTableView操作方式与标准的UITableView相同。

@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

从图中可以看出所有方法都是可选的。如果您选择实现协议,您的表格所使用的UITableViewDataSource应该实现DragAndDropTableViewDataSource协议,您的UITableViewDelegate应该实现DragAndDropTableViewDelegate协议。

请参阅示例项目以获取进一步的帮助。

联系

如果您正在使用DragAndDropTableView,我很乐意听到您的反馈。在Twitter上发消息给我。

许可证

DragAndDropTableView在MIT许可证下可用。有关更多信息,请参阅LICENSE文件。