Here is my code currently. The problem is that the beige background color is there even when I select the cell. I know I should set a different background configuration for every state that I need to, but I don't know how for this default cell. I have created custom UICollectionViewListCells and set a different background on those depending on state. But can't figure out how to do that with the default cells.
Code Block let cellRegistration = UICollectionView.CellRegistration<UICollectionViewListCell, CellItem> { (cell, indexPath, cellItem) in var content = cell.defaultContentConfiguration() content.text = cellItem.title content.secondaryText = cellItem.subText if let imageName = cellItem.imageName { content.image = UIImage(named: imageName) } cell.contentConfiguration = content cell.accessories = [.disclosureIndicator()] var backgroundConfig = UIBackgroundConfiguration.listGroupedCell() /* Set a beige background color to use the cell's tint color. */ backgroundConfig.backgroundColor = UIColor(named: "CellColor") backgroundConfig.strokeColor = .green cell.backgroundConfiguration = backgroundConfig }