forked from LoopKit/LoopKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChartTableViewCell.swift
More file actions
74 lines (56 loc) · 1.71 KB
/
ChartTableViewCell.swift
File metadata and controls
74 lines (56 loc) · 1.71 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//
// ChartTableViewCell.swift
// Naterade
//
// Created by Nathan Racklyeft on 2/19/16.
// Copyright © 2016 Nathan Racklyeft. All rights reserved.
//
import UIKit
public final class ChartTableViewCell: UITableViewCell {
@IBOutlet weak var chartContentView: ChartContainerView!
@IBOutlet weak var titleLabel: UILabel?
@IBOutlet weak var subtitleLabel: UILabel?
@IBOutlet weak var rightArrowHint: UIImageView? {
didSet {
rightArrowHint?.isHidden = !doesNavigate
}
}
public var doesNavigate: Bool = true {
didSet {
rightArrowHint?.isHidden = !doesNavigate
}
}
public override func prepareForReuse() {
super.prepareForReuse()
doesNavigate = true
chartContentView.chartGenerator = nil
}
public func reloadChart() {
chartContentView.reloadChart()
}
public func setChartGenerator(generator: ((CGRect) -> UIView?)?) {
chartContentView.chartGenerator = generator
}
public func setTitleLabelText(label: String?) {
titleLabel?.text = label
}
public func removeTitleLabelText() {
titleLabel?.text?.removeAll()
}
public func setSubtitleLabel(label: String?) {
subtitleLabel?.text = label
}
public func removeSubtitleLabelText() {
subtitleLabel?.text?.removeAll()
}
public func setTitleTextColor(color: UIColor) {
titleLabel?.textColor = color
}
public func setSubtitleTextColor(color: UIColor) {
subtitleLabel?.textColor = color
}
public func setAlpha(alpha: CGFloat) {
titleLabel?.alpha = alpha
subtitleLabel?.alpha = alpha
}
}