I change one property of an item (not a property in the sort descriptors) in CloudKit Dashboard.
When I receive the notification by CloudKit if it is not the first row of the section it gives an .update type (which is correct).
But when the row that should be updated is the first one in any section it gives a .move type (which doesn't refresh my cell).
this is my delegate method:
func controller(_ controller: NSFetchedResultsController<NSFetchRequestResult>, didChange anObject: Any, at indexPath: IndexPath?, for type: NSFetchedResultsChangeType, newIndexPath: IndexPath?) {
switch type {
case .insert:
tableView.insertRows(at: [newIndexPath!], with: .fade)
case .delete:
tableView.deleteRows(at: [indexPath!], with: .fade)
case .update:
tableView.reloadRows(at: [newIndexPath!], with: .automatic)
case .move:
tableView.moveRow(at: indexPath!, to: newIndexPath!)
default:
return
}
}
When I receive the notification by CloudKit if it is not the first row of the section it gives an .update type (which is correct).
But when the row that should be updated is the first one in any section it gives a .move type (which doesn't refresh my cell).
this is my delegate method:
func controller(_ controller: NSFetchedResultsController<NSFetchRequestResult>, didChange anObject: Any, at indexPath: IndexPath?, for type: NSFetchedResultsChangeType, newIndexPath: IndexPath?) {
switch type {
case .insert:
tableView.insertRows(at: [newIndexPath!], with: .fade)
case .delete:
tableView.deleteRows(at: [indexPath!], with: .fade)
case .update:
tableView.reloadRows(at: [newIndexPath!], with: .automatic)
case .move:
tableView.moveRow(at: indexPath!, to: newIndexPath!)
default:
return
}
}