{"id":2840,"url":"https://github.com/adamshin/SwiftReorder","last_synced_at":"2025-08-03T12:31:18.468Z","repository":{"id":49390526,"uuid":"65601000","full_name":"adamshin/SwiftReorder","owner":"adamshin","description":"Easy UITableView drag-and-drop cell reordering","archived":false,"fork":false,"pushed_at":"2020-04-14T18:54:04.000Z","size":415,"stargazers_count":398,"open_issues_count":20,"forks_count":75,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-04-24T18:57:44.765Z","etag":null,"topics":["ios","swift","swift-3","swift-library","ui-components","uikit","uitableview"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adamshin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-13T05:27:33.000Z","updated_at":"2024-03-29T18:03:17.000Z","dependencies_parsed_at":"2022-09-14T08:02:06.836Z","dependency_job_id":null,"html_url":"https://github.com/adamshin/SwiftReorder","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamshin%2FSwiftReorder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamshin%2FSwiftReorder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamshin%2FSwiftReorder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamshin%2FSwiftReorder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adamshin","download_url":"https://codeload.github.com/adamshin/SwiftReorder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228438743,"owners_count":17920012,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ios","swift","swift-3","swift-library","ui-components","uikit","uitableview"],"created_at":"2024-01-05T20:16:24.225Z","updated_at":"2024-12-07T00:30:58.850Z","avatar_url":"https://github.com/adamshin.png","language":"Swift","funding_links":[],"categories":["UI","Swift"],"sub_categories":["Table View / Collection View","Layout","Other free courses"],"readme":"# SwiftReorder\n\n**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](https://developer.apple.com/documentation/uikit/views_and_controls/table_views/supporting_drag_and_drop_in_table_views) instead.**\n\nSwiftReorder 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.\n\n![Demo](Resources/demo.gif)\n\n## Features\n\n- Smooth animations\n- Automatic edge scrolling\n- Works with multiple table sections\n- Customizable shadow, scaling, and transparency effects\n\n## Installation\n\n### CocoaPods\n\nTo integrate SwiftReorder into your Xcode project using CocoaPods, specify it in your `Podfile`:\n\n```ruby\npod 'SwiftReorder', '~\u003e 7.2'\n```\n\n### Carthage\n\nTo integrate SwiftReorder into your Xcode project using Carthage, specify it in your `Cartfile`:\n\n```\ngithub \"adamshin/SwiftReorder\" ~\u003e 7.2\n```\n\nRemember to [add SwiftReorder to your Carthage build phase](https://github.com/Carthage/Carthage#if-youre-building-for-ios-tvos-or-watchos):\n\n```\n$(SRCROOT)/Carthage/Build/iOS/SwiftReorder.framework\n```\n\nand\n\n```\n$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/SwiftReorder.framework\n```\n\n### Manually\n\nYou can integrate SwiftReorder into your project manually by copying the contents of the `Source` folder into your project.\n\n## Usage\n\n### Setup\n\n* Add the following line to your table view setup.\n```swift\noverride func viewDidLoad() {\n    // ...\n    tableView.reorder.delegate = self\n}\n```\n* Add this code to the beginning of your `tableView(_:cellForRowAt:)`.\n```swift\nfunc tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -\u003e UITableViewCell {\n    if let spacer = tableView.reorder.spacerCell(for: indexPath) {\n        return spacer\n    }\n    // ...\n}\n```\n* Implement the `tableView(_:reorderRowAt:to:)` delegate method, and others as necessary.\n```swift\nextension MyViewController: TableViewReorderDelegate {\n    func tableView(_ tableView: UITableView, reorderRowAt sourceIndexPath: IndexPath, to destinationIndexPath: IndexPath) {\n        // Update data model\n    }\n}\n```\nThis 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.\n\n### Customization\nSwiftReorder exposes several properties for adjusting the style of the reordering effect. For example, you can add a scaling effect to the selected cell:\n```swift\ntableView.reorder.cellScale = 1.05\n```\nOr adjust the shadow:\n```swift\ntableView.reorder.shadowOpacity = 0.5\ntableView.reorder.shadowRadius = 20\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamshin%2FSwiftReorder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamshin%2FSwiftReorder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamshin%2FSwiftReorder/lists"}