converted to textStyle
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
b7c250809b
commit
90d83a2ab7
@ -22,7 +22,7 @@ public class TextField: UITextField {
|
|||||||
|
|
||||||
public override init(frame: CGRect) {
|
public override init(frame: CGRect) {
|
||||||
super.init(frame: frame)
|
super.init(frame: frame)
|
||||||
font = TypographicalStyle.BodyLarge.font
|
font = TextStyle.BodyLarge.font
|
||||||
}
|
}
|
||||||
|
|
||||||
public required init?(coder: NSCoder) {
|
public required init?(coder: NSCoder) {
|
||||||
|
|||||||
@ -113,7 +113,7 @@ public class PickerSelectorView<EnumType: RawRepresentable>: UIStackView, Picker
|
|||||||
public func pickerView(_ pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusing view: UIView?) -> UIView {
|
public func pickerView(_ pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusing view: UIView?) -> UIView {
|
||||||
var label = UILabel()
|
var label = UILabel()
|
||||||
if let v = view as? UILabel { label = v }
|
if let v = view as? UILabel { label = v }
|
||||||
label.font = TypographicalStyle.TitleMedium.font
|
label.font = TextStyle.TitleMedium.font
|
||||||
label.text = title(for: row)
|
label.text = title(for: row)
|
||||||
label.textAlignment = .center
|
label.textAlignment = .center
|
||||||
return label
|
return label
|
||||||
@ -146,7 +146,7 @@ public class TextPositionPickerSelectorView: PickerSelectorView<TextPosition>{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TextSizePickerSelectorView: PickerSelectorView<TypographicalStyle.FontSize>{
|
public class TextSizePickerSelectorView: PickerSelectorView<TextStyle.FontSize>{
|
||||||
init(title: String, picker: UIPickerView? = nil){
|
init(title: String, picker: UIPickerView? = nil){
|
||||||
super.init(title: title, picker: picker, items: [.small, .large])
|
super.init(title: title, picker: picker, items: [.small, .large])
|
||||||
}
|
}
|
||||||
@ -156,9 +156,9 @@ public class TextSizePickerSelectorView: PickerSelectorView<TypographicalStyle.F
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class FontCategoryPickerSelectorView: PickerSelectorView<TypographicalStyle.FontCategory>{
|
public class FontCategoryPickerSelectorView: PickerSelectorView<TextStyle.FontCategory>{
|
||||||
init(title: String, picker: UIPickerView? = nil){
|
init(title: String, picker: UIPickerView? = nil){
|
||||||
super.init(title: title, picker: picker, items: TypographicalStyle.FontCategory.allCases)
|
super.init(title: title, picker: picker, items: TextStyle.FontCategory.allCases)
|
||||||
}
|
}
|
||||||
|
|
||||||
required init(coder: NSCoder) {
|
required init(coder: NSCoder) {
|
||||||
|
|||||||
@ -86,7 +86,7 @@ class LabelViewController: BaseViewController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Picker
|
//Picker
|
||||||
private var fontCategory: TypographicalStyle.FontCategory = .feature {
|
private var fontCategory: TextStyle.FontCategory = .feature {
|
||||||
didSet {
|
didSet {
|
||||||
fontCategoryPickerSelectorView.text = fontCategory.rawValue
|
fontCategoryPickerSelectorView.text = fontCategory.rawValue
|
||||||
textSizePickerSelectorView.items = fontCategory.sizes
|
textSizePickerSelectorView.items = fontCategory.sizes
|
||||||
@ -99,7 +99,7 @@ class LabelViewController: BaseViewController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private var textSize: TypographicalStyle.FontSize? = .large {
|
private var textSize: TextStyle.FontSize? = .large {
|
||||||
didSet {
|
didSet {
|
||||||
textSizePickerSelectorView.text = textSize?.rawValue ?? ""
|
textSizePickerSelectorView.text = textSize?.rawValue ?? ""
|
||||||
updateLabelStyle()
|
updateLabelStyle()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user