DragAndDropTableView
A UITableView where cells can be rearranged by drag and drop.
Install / Use
/learn @grillbiff/DragAndDropTableViewREADME
DragAndDropTableView
DragAndDropTableView is a UITableView which supports drag and drop reordering of table cells.
Installation
Manual
- Download sources and add the DragAndDropFolder to your project
- Make sure the QuartzCore framework is added to your project
- Create a DragAndDropTable and start dragging and dropping
CocoaPods
pod 'DragAndDropTableView', '~> 0.1'
Usage
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.
Contact
If you are using DragAndDropTableView I would love to hear about it. Send me a ping on Twitter
Licence
DragAndDropTableView is available under the MIT license. See the LICENSE file for more info.
Related Skills
node-connect
347.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
