this code was fully working prior updating to ios 11 and swift 4, I don't know what's happening I have also attached a video showing the issue.
I can't move the rows anymore. Any advise? Thanks.
override func tableView(_ tableView: UITableView, canMoveRowAt indexPath: IndexPath) -> Bool {
return true
}
//Do the Move action
override func tableView(_ tableView: UITableView, moveRowAt sourceIndexPath: IndexPath, to destinationIndexPath: IndexPath) {
let moveMainArray:String = mainArrayTableName[sourceIndexPath.row]
mainArrayTableName.remove(at: sourceIndexPath.row)
mainArrayTableName.insert(moveMainArray, at: destinationIndexPath.row)
print(mainArrayTableName[destinationIndexPath.row])
let moveFirstName:String = firstName[sourceIndexPath.row]
firstName.remove(at: sourceIndexPath.row)
firstName.insert(moveFirstName, at: destinationIndexPath.row)
print(firstName[destinationIndexPath.row])
let moveLastName:String = lastName[sourceIndexPath.row]
lastName.remove(at: sourceIndexPath.row)
lastName.insert(moveLastName, at: destinationIndexPath.row)
print(lastName[destinationIndexPath.row])
let moveTotalAmount:String = totalAmount[sourceIndexPath.row]
totalAmount.remove(at: sourceIndexPath.row)
totalAmount.insert(moveTotalAmount, at: destinationIndexPath.row)
print(totalAmount[destinationIndexPath.row])
let moveLastAmount:String = lastAmount[sourceIndexPath.row]
lastAmount.remove(at: sourceIndexPath.row)
lastAmount.insert(moveLastAmount, at: destinationIndexPath.row)
print(lastAmount[destinationIndexPath.row])
let moveAddress:String = address[sourceIndexPath.row]
address.remove(at: sourceIndexPath.row)
address.insert(moveAddress, at: destinationIndexPath.row)
print(address[destinationIndexPath.row])
let movePhoneNbr:String = phoneNbr[sourceIndexPath.row]
phoneNbr.remove(at: sourceIndexPath.row)
phoneNbr.insert(movePhoneNbr, at: destinationIndexPath.row)
print(phoneNbr[destinationIndexPath.row])
let moveLastPayment:String = lastPaymentDate[sourceIndexPath.row]
lastPaymentDate.remove(at: sourceIndexPath.row)
lastPaymentDate.insert(moveLastPayment, at: destinationIndexPath.row)
print(lastPaymentDate[destinationIndexPath.row])
let moveNextPayment:String = nextPaymentDate[sourceIndexPath.row]
nextPaymentDate.remove(at: sourceIndexPath.row)
nextPaymentDate.insert(moveNextPayment, at: destinationIndexPath.row)
print(nextPaymentDate[destinationIndexPath.row])
let moveRemaining:String = remainingAmount[sourceIndexPath.row]
remainingAmount.remove(at: sourceIndexPath.row)
remainingAmount.insert(moveRemaining, at: destinationIndexPath.row)
print(remainingAmount[destinationIndexPath.row])
print(userID[destinationIndexPath.row])
}
Link for the Video: https://www.dropbox.com/s/0c0tlldbehrpslo/ScreenRecording_04-10-2018%2021-17-03.MP4?dl=0
Thanks again