updates for debugging
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
b7ef70820d
commit
df91effafb
@ -333,7 +333,7 @@ extension LabelViewController: ComponentSampleable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
extension BaseViewController {
|
extension BaseViewController {
|
||||||
func descriptionFor(style: TextStyle, useScaledLineHeight: Bool = false, scaledMode: Bool) -> String {
|
func descriptionFor(style: TextStyle, useScaledLineHeight: Bool = false, scaledMode: Bool = false) -> String {
|
||||||
let scaledFont = style.font.scaledFont
|
let scaledFont = style.font.scaledFont
|
||||||
var customizedDesc: String = "Name: \(style.rawValue) \nFont Face-Weight: \(style.font.fontName)"
|
var customizedDesc: String = "Name: \(style.rawValue) \nFont Face-Weight: \(style.font.fontName)"
|
||||||
customizedDesc += "\nVDS LetterSpacing: \(style.letterSpacing)"
|
customizedDesc += "\nVDS LetterSpacing: \(style.letterSpacing)"
|
||||||
|
|||||||
@ -113,15 +113,19 @@ class TitleLockupViewController: BaseViewController<TitleLockup> {
|
|||||||
titleTextField.text = titleModel.text
|
titleTextField.text = titleModel.text
|
||||||
subTitleTextField.text = subTitleModel.text
|
subTitleTextField.text = subTitleModel.text
|
||||||
|
|
||||||
|
setTitleModel()
|
||||||
updateOtherTextStyles()
|
updateOtherTextStyles()
|
||||||
}
|
}
|
||||||
|
|
||||||
func setTitleModel() {
|
func setTitleModel() {
|
||||||
|
var titleTextStyle: TextStyle?
|
||||||
if let text = titleTextField.text, !text.isEmpty {
|
if let text = titleTextField.text, !text.isEmpty {
|
||||||
component.titleModel = TitleLockup.TitleModel(text: text, isBold: titleIsBold.isOn, standardStyle: titleStandardStylePickerSelectorView.selectedItem)
|
component.titleModel = TitleLockup.TitleModel(text: text, isBold: titleIsBold.isOn, standardStyle: titleStandardStylePickerSelectorView.selectedItem)
|
||||||
|
titleTextStyle = titleIsBold.isOn ? titleStandardStylePickerSelectorView.selectedItem.value.bold : titleStandardStylePickerSelectorView.selectedItem.value.regular
|
||||||
} else {
|
} else {
|
||||||
component.titleModel = nil
|
component.titleModel = nil
|
||||||
}
|
}
|
||||||
|
debug(type: "Title", textStyle: titleTextStyle)
|
||||||
}
|
}
|
||||||
|
|
||||||
func updateOtherTextStyles() {
|
func updateOtherTextStyles() {
|
||||||
@ -136,17 +140,25 @@ class TitleLockupViewController: BaseViewController<TitleLockup> {
|
|||||||
|
|
||||||
if let text = subTitleTextField.text, !text.isEmpty {
|
if let text = subTitleTextField.text, !text.isEmpty {
|
||||||
component.subTitleModel = TitleLockup.SubTitleModel(text: text, standardStyle: style, textColor: subtitleColorPickerSelectorView.selectedItem)
|
component.subTitleModel = TitleLockup.SubTitleModel(text: text, standardStyle: style, textColor: subtitleColorPickerSelectorView.selectedItem)
|
||||||
|
debug(type: "SubTitle", textStyle: style.value.regular)
|
||||||
} else {
|
} else {
|
||||||
component.subTitleModel = nil
|
component.subTitleModel = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if let text = eyebrowTextField.text, !text.isEmpty {
|
if let text = eyebrowTextField.text, !text.isEmpty {
|
||||||
component.eyebrowModel = TitleLockup.EyebrowModel(text: text, isBold: eyebrowIsBold.isOn, standardStyle: style)
|
component.eyebrowModel = TitleLockup.EyebrowModel(text: text, isBold: eyebrowIsBold.isOn, standardStyle: style)
|
||||||
|
debug(type: "EyeBrow", textStyle: eyebrowIsBold.isOn ? style.value.bold : style.value.regular)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
component.eyebrowModel = nil
|
component.eyebrowModel = nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func debug(type: String, textStyle: TextStyle?) {
|
||||||
|
guard let textStyle else { return }
|
||||||
|
DebugLog("\n\(type)\n\(descriptionFor(style: textStyle))\n\n")
|
||||||
|
}
|
||||||
|
|
||||||
//Picker
|
//Picker
|
||||||
func setupPicker(){
|
func setupPicker(){
|
||||||
surfacePickerSelectorView.onPickerDidSelect = { [weak self] item in
|
surfacePickerSelectorView.onPickerDidSelect = { [weak self] item in
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user