Updates the data for the rows at the index paths you specify, preserving the existing cells for the rows.

Declaration

func reconfigureRows(at indexPaths: [IndexPath])

Parameters

indexPaths

An array of NSIndexPath objects identifying the items you want to update.

Discussion

To update the contents of existing (including prefetched) cells without replacing them with new cells, use this method instead of reloadRows(at:with:). For optimal performance, choose to reconfigure rows instead of reloading rows unless you have an explicit need to replace the existing cell with a new cell.

Your cell provider must dequeue the same type of cell for the provided index path, and must return the same existing cell for a given index path.

Because this method reconfigures existing cells, the table view doesn’t call prepareForReuse() for each cell dequeued. If you need to return a different type of cell for an index path, use reloadRows(at:with:) instead.

If your cells are self-sizing, the table view resizes your cells after reconfiguring them.

By default, the table view animates any size or layout changes that are a result of reconfiguration. To reconfigure cells without animation, use UIView’s performWithoutAnimation(_:) when you call this method.