-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
DashboardReferrerRowStackView.swift
42 lines (31 loc) · 1.38 KB
/
DashboardReferrerRowStackView.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
import Library
import KsApi
import Prelude
import UIKit
internal final class DashboardReferrerRowStackView: UIStackView {
fileprivate let viewModel: DashboardReferrerRowStackViewViewModelType
= DashboardReferrerRowStackViewViewModel()
fileprivate let backersLabel: UILabel = UILabel()
fileprivate let pledgedLabel: UILabel = UILabel()
fileprivate let sourceLabel: UILabel = UILabel()
internal init(frame: CGRect,
country: Project.Country,
referrer: ProjectStatsEnvelope.ReferrerStats) {
super.init(frame: frame)
_ = self |> dashboardStatsRowStackViewStyle
_ = self.backersLabel |> dashboardColumnTextLabelStyle
_ = self.pledgedLabel |> dashboardColumnTextLabelStyle
_ = self.sourceLabel |> dashboardReferrersSourceLabelStyle
self.addArrangedSubview(self.sourceLabel)
self.addArrangedSubview(self.pledgedLabel)
self.addArrangedSubview(self.backersLabel)
self.backersLabel.rac.text = self.viewModel.outputs.backersText
self.pledgedLabel.rac.text = self.viewModel.outputs.pledgedText
self.sourceLabel.rac.text = self.viewModel.outputs.sourceText
self.sourceLabel.rac.textColor = self.viewModel.outputs.textColor
self.viewModel.inputs.configureWith(country: country, referrer: referrer)
}
required init(coder aDecoder: NSCoder) {
fatalError("init(coder:\(aDecoder)) has not been implemented")
}
}