Hi there!
I want to bring the records of CoreData in the same order like my array. How can I do that?
That’s my code:
override func tableView(tableView: UITableView, moveRowAtIndexPath sourceIndexPath: NSIndexPath, toIndexPath destinationIndexPath: NSIndexPath)
{
var destinationData = folders
let folder = folders[sourceIndexPath.row]
if sourceIndexPath != destinationIndexPath
{
folders.removeAtIndex(sourceIndexPath.row)
folders.insert(folder, atIndex: destinationIndexPath.row)
swap(&destinationData[destinationIndexPath.row], &destinationData[sourceIndexPath.row])
saveData()
}
}
Sorry for the simple english, I’m from Germany and I do my best.
Thanks!