refactored naming conventions in object
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
8daf1a2b72
commit
881fd5e433
@ -68,23 +68,35 @@ open class TileletModel: MoleculeModelProtocol {
|
||||
public func titleModel(delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) -> Tilelet.TitleModel? {
|
||||
guard let title else { return nil }
|
||||
let attrs = title.attributes?.toVDSLabelAttributeModel(delegateObject: delegateObject, additionalData: additionalData)
|
||||
let style: TextStyle? = title.fontStyle?.vdsTextStyle()
|
||||
if let style, let standardStyle = Tilelet.TitleModel.StandardStyle(rawValue: style.toStandardStyle().rawValue) {
|
||||
return .init(text: title.text, textAttributes: attrs, standardStyle: standardStyle)
|
||||
} else {
|
||||
return .init(text: title.text, textAttributes: attrs)
|
||||
}
|
||||
}
|
||||
|
||||
do {
|
||||
if let style = title.fontStyle {
|
||||
return .init(text: title.text,
|
||||
textAttributes: attrs,
|
||||
standardStyle: try style.vdsSubsetStyle())
|
||||
}
|
||||
|
||||
} catch MVMCoreError.errorObject(let object) {
|
||||
MVMCoreLoggingHandler.shared()?.addError(toLog: object)
|
||||
} catch { }
|
||||
|
||||
return .init(text: title.text, textAttributes: attrs)
|
||||
}
|
||||
|
||||
public func subTitleModel(delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) -> Tilelet.SubTitleModel? {
|
||||
guard let subTitle else { return nil }
|
||||
let attrs = subTitle.attributes?.toVDSLabelAttributeModel(delegateObject: delegateObject, additionalData: additionalData)
|
||||
let style: TextStyle? = subTitle.fontStyle?.vdsTextStyle()
|
||||
if let style, let standardStyle = Tilelet.SubTitleModel.StandardStyle(rawValue: style.toStandardStyle().rawValue) {
|
||||
return .init(text: subTitle.text, textAttributes: attrs, standardStyle: standardStyle)
|
||||
} else {
|
||||
return .init(text: subTitle.text, textAttributes: attrs)
|
||||
}
|
||||
do {
|
||||
if let style = subTitle.fontStyle {
|
||||
return .init(text: subTitle.text,
|
||||
otherStandardStyle: try style.vdsSubsetStyle(),
|
||||
textAttributes: attrs)
|
||||
}
|
||||
} catch MVMCoreError.errorObject(let object) {
|
||||
MVMCoreLoggingHandler.shared()?.addError(toLog: object)
|
||||
} catch { }
|
||||
|
||||
return .init(text: subTitle.text, textAttributes: attrs)
|
||||
}
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
|
||||
@ -138,7 +138,7 @@ public class TitleLockupModel: MoleculeModelProtocol, ParentMoleculeModelProtoco
|
||||
do {
|
||||
if let style = subTitle.fontStyle {
|
||||
return .init(text: subTitle.text,
|
||||
standardStyle: try style.vdsSubsetStyle(),
|
||||
otherStandardStyle: try style.vdsSubsetStyle(),
|
||||
textColor: subTitleColor,
|
||||
textAttributes: attrs,
|
||||
numberOfLines: subTitle.numberOfLines ?? 0)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user