You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NOTE: Some users have encountered compatibility issues when using this library with recent versions of iOS. For apps targeting iOS 11 and up, it's recommended to use the built-in UITableView drag and drop API instead.
SwiftReorder is a UITableView extension that lets you add long-press drag-and-drop reordering to any table view. It's robust, lightweight, and fully customizable.
Features
Smooth animations
Automatic edge scrolling
Works with multiple table sections
Customizable shadow, scaling, and transparency effects
Installation
CocoaPods
To integrate SwiftReorder into your Xcode project using CocoaPods, specify it in your Podfile:
pod'SwiftReorder','~> 7.2'
Carthage
To integrate SwiftReorder into your Xcode project using Carthage, specify it in your Cartfile:
Implement the tableView(_:reorderRowAt:to:) delegate method, and others as necessary.
extensionMyViewController:TableViewReorderDelegate{func tableView(_ tableView:UITableView, reorderRowAt sourceIndexPath:IndexPath, to destinationIndexPath:IndexPath){
// Update data model
}}
This method is analogous to the UITableViewDataSource method tableView(_:moveRowAt:to:). However, it may be called multiple times in the course of one drag-and-drop action.
Customization
SwiftReorder exposes several properties for adjusting the style of the reordering effect. For example, you can add a scaling effect to the selected cell: