indexPath(for:)
Returns an index path for the item with the specified identifier in the table view.
Declaration
@MainActor @preconcurrency func indexPath(for itemIdentifier: ItemIdentifierType) -> IndexPath?Parameters
- itemIdentifier:
The identifier of the item in the table view.
Return Value
The item’s index path, or nil if no item is found with the provided item identifier.
Discussion
This method is a constant time operation, O(1), which means you can look up an index path from its corresponding item identifier with no significant overhead.