Thank you. That's what I was looking for.
Post
Replies
Boosts
Views
Activity
Thank you for that detailed answer.
I had naively tried to perform an animation with setNeedsUpdateConfiguration() in an animation block but it didn't work. Now that I know that it's a correct pattern handled by UIKit, I will make other tests.
Thank you for taking the time to answer my question clearly. It helped!
I still have some hesitation about the choice: custom configurations versus custom cells.
From what I understand, if I make a custom cell, I cannot have a custom configuration. Let's take an example:
If I make a custom UICollectionViewListCell cell for a sidebar, then use UIListContentConfiguration.sidebarCell() in order to have all its rendering for free (text label, image view, ...). I would insert the UIListContentView associated to UIListContentConfiguration.sidebarCell() in the view hiearchy and add some custom views.
If I have some properties controlling the appearance for these extra custom views, they should be placed in a configuration but since my custom views are in the cell's context, it's not possible because I don't have any configuration associated to them.
So, in this case, I think it's a limitation of the API and I need to place these properties in the UICellConfigurationState custom key value store.
Excellent, you answer clarifies all the patterns we can use for different kinds of custom cells. Thank you again.
I found the solution using the modifier interactiveDismissDisabled(_:) https://developer.apple.com/documentation/swiftui/view/interactivedismissdisabled(_:)?changes=latest_minor