I'd love for this operation to be O(1) like itemIdentifier(for:) - https://developer.apple.com/documentation/uikit/uicollectionviewdiffabledatasourcereference/3182924-itemidentifier:
This method is a constant time operation, O(1), which means you can look up an item identifier from its corresponding index path with no significant overhead.
I fear, perhaps unnecessarily, that snapshot() is an O(n) operation meaning retrieving the section identifier turns into an expensive operation.
Can someone from Apple chime in here?
Topic:
UI Frameworks
SubTopic:
UIKit
Tags: