Post

Replies

Boosts

Views

Activity

Reply to UICollectionViewCell Selected State Won't Highlight the Cell
var background = UIBackgroundConfiguration.listGroupedCell().updated(for: state) background.cornerRadius = 25 // Update background based on selection state if state.isSelected { background.backgroundColor = .systemBlue.withAlphaComponent(0.3) background.strokeColor = UIColor.systemBlue background.strokeWidth = 1.5 } else { background.backgroundColor = isHoveredOver ? .hoverHighlightBackground : .background background.strokeColor = UIColor.borderColor background.strokeWidth = 1 } backgroundConfiguration = background
Topic: UI Frameworks SubTopic: UIKit Tags:
Nov ’25
Reply to UICollectionViewCell Selected State Won't Highlight the Cell
var background = UIBackgroundConfiguration.listGroupedCell().updated(for: state) background.cornerRadius = 25 // Update background based on selection state if state.isSelected { background.backgroundColor = .systemBlue.withAlphaComponent(0.3) background.strokeColor = UIColor.systemBlue background.strokeWidth = 1.5 } else { background.backgroundColor = isHoveredOver ? .hoverHighlightBackground : .background background.strokeColor = UIColor.borderColor background.strokeWidth = 1 } backgroundConfiguration = background }override func updateConfiguration(using state: UICellConfigurationState) { super.updateConfiguration(using: state) var background = UIBackgroundConfiguration.listGroupedCell().updated(for: state) background.cornerRadius = 25 // Update background based on selection state if state.isSelected { background.backgroundColor = .systemBlue.withAlphaComponent(0.3) background.strokeColor = UIColor.systemBlue background.strokeWidth = 1.5 } else { background.backgroundColor = isHoveredOver ? .hoverHighlightBackground : .background background.strokeColor = UIColor.borderColor background.strokeWidth = 1 } backgroundConfiguration = background }
Topic: UI Frameworks SubTopic: UIKit Tags:
Nov ’25
Reply to UICollectionViewCell Selected State Won't Highlight the Cell
override func updateConfiguration(using state: UICellConfigurationState) { super.updateConfiguration(using: state) var background = UIBackgroundConfiguration.listGroupedCell().updated(for: state) background.cornerRadius = 25 // Update background based on selection state if state.isSelected { background.backgroundColor = .systemBlue.withAlphaComponent(0.3) background.strokeColor = UIColor.systemBlue background.strokeWidth = 1.5 } else { background.backgroundColor = isHoveredOver ? .hoverHighlightBackground : .background background.strokeColor = UIColor.borderColor background.strokeWidth = 1 } backgroundConfiguration = background }override func updateConfiguration(using state: UICellConfigurationState) { super.updateConfiguration(using: state) var background = UIBackgroundConfiguration.listGroupedCell().updated(for: state) background.cornerRadius = 25 // Update background based on selection state if state.isSelected { background.backgroundColor = .systemBlue.withAlphaComponent(0.3) background.strokeColor = UIColor.systemBlue background.strokeWidth = 1.5 } else { background.backgroundColor = isHoveredOver ? .hoverHighlightBackground : .background background.strokeColor = UIColor.borderColor background.strokeWidth = 1 } backgroundConfiguration = background }
Topic: UI Frameworks SubTopic: UIKit Tags:
Nov ’25