metatext/Views/CompositionAttachmentCollectionViewCell.swift

20 lines
714 B
Swift
Raw Normal View History

2020-12-17 06:48:06 +00:00
// Copyright © 2020 Metabolist. All rights reserved.
import UIKit
2020-12-19 06:30:19 +00:00
import ViewModels
2020-12-17 06:48:06 +00:00
class CompositionAttachmentCollectionViewCell: UICollectionViewCell {
2020-12-19 06:30:19 +00:00
var viewModel: CompositionAttachmentViewModel?
2021-01-03 01:22:17 +00:00
var parentViewModel: CompositionViewModel?
2020-12-19 06:30:19 +00:00
override func updateConfiguration(using state: UICellConfigurationState) {
2021-01-03 01:22:17 +00:00
guard let viewModel = viewModel, let parentViewModel = parentViewModel else { return }
2020-12-19 06:30:19 +00:00
2021-01-03 01:22:17 +00:00
contentConfiguration = CompositionAttachmentContentConfiguration(
viewModel: viewModel,
parentViewModel: parentViewModel)
.updated(for: state)
2020-12-19 06:30:19 +00:00
backgroundConfiguration = UIBackgroundConfiguration.clear().updated(for: state)
}
2020-12-17 06:48:06 +00:00
}