metatext/Views/UIKit/Collection View Cells/AnnouncementReactionCollectionViewCell.swift
Justin Mazzocchi 3f7a6a26aa
Announcements
2021-04-25 22:24:17 -07:00

25 lines
812 B
Swift

// Copyright © 2021 Metabolist. All rights reserved.
import UIKit
import ViewModels
final class AnnouncementReactionCollectionViewCell: UICollectionViewCell {
var viewModel: AnnouncementReactionViewModel?
override func updateConfiguration(using state: UICellConfigurationState) {
guard let viewModel = viewModel else { return }
contentConfiguration = AnnouncementReactionContentConfiguration(viewModel: viewModel)
var backgroundConfiguration = UIBackgroundConfiguration.listPlainCell().updated(for: state)
if !state.isHighlighted && !state.isSelected {
backgroundConfiguration.backgroundColor = .clear
}
backgroundConfiguration.cornerRadius = .defaultCornerRadius
self.backgroundConfiguration = backgroundConfiguration
}
}