From 9ee7f6dbdb045342778e4c186cc3fc2cd8e7d8d6 Mon Sep 17 00:00:00 2001 From: nixzhu Date: Wed, 24 Jun 2015 14:32:16 +0800 Subject: [PATCH] colorTitleLabelFontStyle --- .../ConversationMoreView.swift | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/Yep/Views/ConversationMore/ConversationMoreView.swift b/Yep/Views/ConversationMore/ConversationMoreView.swift index dc2f0fda..923914d2 100644 --- a/Yep/Views/ConversationMore/ConversationMoreView.swift +++ b/Yep/Views/ConversationMore/ConversationMoreView.swift @@ -77,12 +77,29 @@ class ConversationMoreColorTitleCell: UITableViewCell { }() var colorTitleLabelTextColor: UIColor = UIColor.yepTintColor() { - didSet { - colorTitleLabel.textColor = colorTitleLabelTextColor + willSet { + colorTitleLabel.textColor = newValue + } + } + + enum FontStyle { + case Light + case Regular + } + + var colorTitleLabelFontStyle: FontStyle = .Light { + willSet { + switch newValue { + case .Light: + colorTitleLabel.font = UIFont(name: "Helvetica-Light", size: 18)! + case .Regular: + colorTitleLabel.font = UIFont(name: "Helvetica", size: 18)! + } } } func makeUI() { + contentView.addSubview(colorTitleLabel) colorTitleLabel.setTranslatesAutoresizingMaskIntoConstraints(false) @@ -201,6 +218,7 @@ extension ConversationMoreView: UITableViewDataSource, UITableViewDelegate { cell.colorTitleLabel.text = NSLocalizedString("Report", comment: "") cell.colorTitleLabelTextColor = UIColor.yepTintColor() + cell.colorTitleLabelFontStyle = .Light return cell @@ -209,6 +227,7 @@ extension ConversationMoreView: UITableViewDataSource, UITableViewDelegate { cell.colorTitleLabel.text = NSLocalizedString("Block", comment: "") cell.colorTitleLabelTextColor = UIColor.redColor() + cell.colorTitleLabelFontStyle = .Light return cell @@ -217,6 +236,7 @@ extension ConversationMoreView: UITableViewDataSource, UITableViewDelegate { cell.colorTitleLabel.text = NSLocalizedString("Cancel", comment: "") cell.colorTitleLabelTextColor = UIColor.yepTintColor() + cell.colorTitleLabelFontStyle = .Regular return cell