Skip to content

Instantly share code, notes, and snippets.

@pgpt10
Created November 10, 2017 12:48
Show Gist options
  • Save pgpt10/e490907ca590355e9fd9f560ae1f0bd4 to your computer and use it in GitHub Desktop.
Save pgpt10/e490907ca590355e9fd9f560ae1f0bd4 to your computer and use it in GitHub Desktop.
func tableView(_ tableView: UITableView, canMoveRowAt indexPath: IndexPath) -> Bool
{
return true
}
func tableView(_ tableView: UITableView, moveRowAt sourceIndexPath: IndexPath, to destinationIndexPath: IndexPath)
{
let item = self.items[sourceIndexPath.row]
self.items.remove(at: sourceIndexPath.row)
self.items.insert(item, at: destinationIndexPath.row)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment