-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
DashboardProjectsDrawerCell.swift
45 lines (35 loc) · 1.52 KB
/
DashboardProjectsDrawerCell.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import KsApi
import Library
import Prelude
import UIKit
internal final class DashboardProjectsDrawerCell: UITableViewCell, ValueCell {
@IBOutlet fileprivate var projectNumLabel: UILabel!
@IBOutlet fileprivate var projectNameLabel: UILabel!
@IBOutlet fileprivate var checkmarkImageView: UIImageView!
fileprivate let viewModel: DashboardProjectsDrawerCellViewModelType =
DashboardProjectsDrawerCellViewModel()
internal func configureWith(value: ProjectsDrawerData) {
self.viewModel.inputs.configureWith(
project: value.project,
indexNum: value.indexNum,
isChecked: value.isChecked
)
}
internal override func bindViewModel() {
super.bindViewModel()
self.projectNumLabel.rac.text = self.viewModel.outputs.projectNumberText
self.projectNameLabel.rac.text = self.viewModel.outputs.projectNameText
self.checkmarkImageView.rac.hidden = self.viewModel.outputs.isCheckmarkHidden
self.rac.accessibilityLabel = self.viewModel.outputs.cellAccessibilityLabel
self.rac.accessibilityValue = self.viewModel.outputs.cellAccessibilityValue
}
internal override func bindStyles() {
super.bindStyles()
_ = self
|> UITableViewCell.lens.isAccessibilityElement .~ true
|> UITableViewCell.lens.accessibilityTraits .~ UIAccessibilityTraits.button
_ = self.projectNumLabel |> dashboardDrawerProjectNumberTextLabelStyle
_ = self.projectNameLabel |> dashboardDrawerProjectNameTextLabelStyle
_ = self.checkmarkImageView |> UIImageView.lens.tintColor .~ .ksr_support_400
}
}