How to control the selection of a UICollectionViewListCell's multi select accessory

I can't find the API to programmatically check or unckeck the multi select accessory in a UICollectionViewListCell accordingly to the model when the cell is displayed.

This is my cell registration:

Code Block
let cellRegistration = UICollectionView.CellRegistration<UICollectionViewListCell, Item> { (cell, indexPath, item) in
var content = cell.defaultContentConfiguration()
content.text = item.title
cell.contentConfiguration = content
cell.accessories = [.multiselect(displayed: .always, options: UICellAccessory.MultiselectOptions())]
}

Answered by Frameworks Engineer in 626778022
The multiselect accessory follows the selected state of the cell. In other words, when you select items in the UICollectionView, the collection view will enable the selected state on the cells corresponding to those selected items, and the multiselect accessory in these cells will automatically show the checked (filled) appearance in that state.

You can use the UICollectionView API selectItem(at:animated:scrollPosition:) (documentation) to programmatically manage the selected items.
Accepted Answer
The multiselect accessory follows the selected state of the cell. In other words, when you select items in the UICollectionView, the collection view will enable the selected state on the cells corresponding to those selected items, and the multiselect accessory in these cells will automatically show the checked (filled) appearance in that state.

You can use the UICollectionView API selectItem(at:animated:scrollPosition:) (documentation) to programmatically manage the selected items.
Thank you. That's what I was looking for.
How to control the selection of a UICollectionViewListCell's multi select accessory
 
 
Q