From 724a6f09cc3053a47a6f8ded9859fee9cc539134 Mon Sep 17 00:00:00 2001 From: Pavan Kataria Date: Mon, 13 Mar 2017 09:58:18 +0000 Subject: [PATCH] Refactors Data Cell and Data CellViewModel to incorporate DataCellTypeValue --- SwiftDataTables/Classes/DataCell/DataCell.swift | 7 +------ SwiftDataTables/Classes/DataCell/DataCellViewModel.swift | 5 +++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/SwiftDataTables/Classes/DataCell/DataCell.swift b/SwiftDataTables/Classes/DataCell/DataCell.swift index 323fcb3..4bf4ff1 100644 --- a/SwiftDataTables/Classes/DataCell/DataCell.swift +++ b/SwiftDataTables/Classes/DataCell/DataCell.swift @@ -15,11 +15,6 @@ class DataCell: UICollectionViewCell { //MARK: - Lifecycle func setup(_ viewModel: DataCellViewModel){ - self.dataLabel.text = viewModel.data - -// self.highlight(viewModel.highlighted) + self.dataLabel.text = viewModel.data.stringRepresentation } -// var representedElementKind = { -// -// } } diff --git a/SwiftDataTables/Classes/DataCell/DataCellViewModel.swift b/SwiftDataTables/Classes/DataCell/DataCellViewModel.swift index c76c0fd..6d6dbb5 100644 --- a/SwiftDataTables/Classes/DataCell/DataCellViewModel.swift +++ b/SwiftDataTables/Classes/DataCell/DataCellViewModel.swift @@ -14,10 +14,11 @@ open class DataCellViewModel: VirtualPositionTrackable, CollectionViewCellRepres var xPositionRunningTotal: CGFloat? = nil var yPositionRunningTotal: CGFloat? = nil var virtualHeight: CGFloat = 0 - let data: String + let data: DataTableValueType + var highlighted: Bool = false //MARK: - Lifecycle - init(data: String){ + init(data: DataTableValueType){ self.data = data } static func registerCell(collectionView: UICollectionView) {