removed helper methods
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
3db7cf0a42
commit
e41812e7c7
@ -232,8 +232,13 @@ open class Tilet: TileContainer {
|
||||
if badgeContainerView.superview == nil {
|
||||
stackView.insertArrangedSubview(badgeContainerView, at: 0)
|
||||
}
|
||||
badge.set(with: badgeModel)
|
||||
badge.text = badgeModel.text
|
||||
badge.fillColor = badgeModel.fillColor
|
||||
badge.numberOfLines = badgeModel.numberOfLines
|
||||
badge.surface = badgeModel.surface
|
||||
badge.maxWidth = badgeModel.maxWidth
|
||||
} else {
|
||||
badge.reset()
|
||||
badgeContainerView.removeFromSuperview()
|
||||
}
|
||||
|
||||
@ -276,9 +281,14 @@ open class Tilet: TileContainer {
|
||||
titleLockupTrailingConstraint?.isActive = true
|
||||
}
|
||||
|
||||
titleLockup.set(with: titleModel)
|
||||
titleLockup.set(with: subTitleModel)
|
||||
//set models
|
||||
titleLockup.titleModel = titleModel?.toTitleLockupTitleModel()
|
||||
titleLockup.subTitleModel = subTitleModel?.toTitleLockupSubTitleModel()
|
||||
|
||||
if let style = subTitleModel?.typographicalStyle.value {
|
||||
titleLockup.otherTypograpicalStyle = style
|
||||
}
|
||||
|
||||
} else {
|
||||
titleLockupContainerView.removeFromSuperview()
|
||||
}
|
||||
|
||||
@ -21,17 +21,3 @@ public struct TiletBadgeModel {
|
||||
self.maxWidth = maxWidth
|
||||
}
|
||||
}
|
||||
|
||||
extension Badge {
|
||||
public func set(with model: TiletBadgeModel?) {
|
||||
if let model, !model.text.isEmpty {
|
||||
text = model.text
|
||||
fillColor = model.fillColor
|
||||
numberOfLines = model.numberOfLines
|
||||
surface = model.surface
|
||||
maxWidth = model.maxWidth
|
||||
} else {
|
||||
reset()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,16 +33,10 @@ public struct TiletSubTitleModel {
|
||||
self.textAttributes = textAttributes
|
||||
self.typographicalStyle = typographicalStyle
|
||||
}
|
||||
}
|
||||
|
||||
extension TitleLockup {
|
||||
internal func set(with model: TiletSubTitleModel?) {
|
||||
if let model, !model.text.isEmpty {
|
||||
subTitleModel = TitleLockupSubTitleModel(text: model.text, textColor: model.textColor, textAttributes: model.textAttributes)
|
||||
otherTypograpicalStyle = model.typographicalStyle.value
|
||||
} else {
|
||||
subTitleModel = nil
|
||||
}
|
||||
}
|
||||
|
||||
public func toTitleLockupSubTitleModel() -> TitleLockupSubTitleModel {
|
||||
TitleLockupSubTitleModel(text: text,
|
||||
textColor: textColor,
|
||||
textAttributes: textAttributes)
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,14 +32,8 @@ public struct TiletTitleModel {
|
||||
self.textAttributes = textAttributes
|
||||
self.typographicalStyle = typographicalStyle
|
||||
}
|
||||
}
|
||||
|
||||
extension TitleLockup {
|
||||
internal func set(with model: TiletTitleModel?) {
|
||||
if let model, !model.text.isEmpty {
|
||||
titleModel = TitleLockupTitleModel(text: model.text, textAttributes: model.textAttributes, typographicalStyle: model.typographicalStyle.value)
|
||||
} else {
|
||||
titleModel = nil
|
||||
}
|
||||
|
||||
public func toTitleLockupTitleModel() -> TitleLockupTitleModel {
|
||||
TitleLockupTitleModel(text: text, textAttributes: textAttributes, typographicalStyle: typographicalStyle.value)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user