updated to convertTo
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
b71a4c5b25
commit
e3f22efb12
@ -16,7 +16,7 @@ extension Array where Element: MVMCoreUI.LabelAttributeModel {
|
|||||||
var attributes: [any VDS.LabelAttributeModel] = []
|
var attributes: [any VDS.LabelAttributeModel] = []
|
||||||
forEach { atomicLabelAttribute in
|
forEach { atomicLabelAttribute in
|
||||||
if let attr = atomicLabelAttribute as? (any VDSLabelAttributeConvertable),
|
if let attr = atomicLabelAttribute as? (any VDSLabelAttributeConvertable),
|
||||||
let vds = attr.convertToVDSLabelAttirbute(delegateObject: delegateObject,
|
let vds = attr.convertToVDSLabelAttribute(delegateObject: delegateObject,
|
||||||
additionalData: additionalData){
|
additionalData: additionalData){
|
||||||
attributes.append(vds)
|
attributes.append(vds)
|
||||||
}
|
}
|
||||||
@ -28,12 +28,12 @@ extension Array where Element: MVMCoreUI.LabelAttributeModel {
|
|||||||
//VDS Convertable Protocol and Extensions
|
//VDS Convertable Protocol and Extensions
|
||||||
public protocol VDSLabelAttributeConvertable<LabelAttributeType> {
|
public protocol VDSLabelAttributeConvertable<LabelAttributeType> {
|
||||||
associatedtype LabelAttributeType: VDS.LabelAttributeModel
|
associatedtype LabelAttributeType: VDS.LabelAttributeModel
|
||||||
func convertToVDSLabelAttirbute(delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) -> LabelAttributeType?
|
func convertToVDSLabelAttribute(delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) -> LabelAttributeType?
|
||||||
}
|
}
|
||||||
|
|
||||||
extension LabelAttributeUnderlineModel: VDSLabelAttributeConvertable {
|
extension LabelAttributeUnderlineModel: VDSLabelAttributeConvertable {
|
||||||
|
|
||||||
public func convertToVDSLabelAttirbute(delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) -> UnderlineLabelAttribute? {
|
public func convertToVDSLabelAttribute(delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) -> UnderlineLabelAttribute? {
|
||||||
guard let style = UnderlineLabelAttribute.Style(rawValue: style.rawValue) else { return nil }
|
guard let style = UnderlineLabelAttribute.Style(rawValue: style.rawValue) else { return nil }
|
||||||
|
|
||||||
var pattern: UnderlineLabelAttribute.Pattern?
|
var pattern: UnderlineLabelAttribute.Pattern?
|
||||||
@ -50,7 +50,7 @@ extension LabelAttributeUnderlineModel: VDSLabelAttributeConvertable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
extension LabelAttributeActionModel: VDSLabelAttributeConvertable {
|
extension LabelAttributeActionModel: VDSLabelAttributeConvertable {
|
||||||
public func convertToVDSLabelAttirbute(delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) -> ActionLabelAttribute? {
|
public func convertToVDSLabelAttribute(delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) -> ActionLabelAttribute? {
|
||||||
var vdsAttribute = VDS.ActionLabelAttribute(location: location, length: length)
|
var vdsAttribute = VDS.ActionLabelAttribute(location: location, length: length)
|
||||||
vdsAttribute.subscriber = vdsAttribute.action.sink { [weak self] in
|
vdsAttribute.subscriber = vdsAttribute.action.sink { [weak self] in
|
||||||
guard let self else { return }
|
guard let self else { return }
|
||||||
@ -64,7 +64,7 @@ extension LabelAttributeActionModel: VDSLabelAttributeConvertable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
extension LabelAttributeFontModel: VDSLabelAttributeConvertable {
|
extension LabelAttributeFontModel: VDSLabelAttributeConvertable {
|
||||||
public func convertToVDSLabelAttirbute(delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) -> TextStyleLabelAttribute? {
|
public func convertToVDSLabelAttribute(delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) -> TextStyleLabelAttribute? {
|
||||||
|
|
||||||
var textStyle: TextStyle?
|
var textStyle: TextStyle?
|
||||||
if let found = style?.vdsTextStyle() {
|
if let found = style?.vdsTextStyle() {
|
||||||
@ -82,7 +82,7 @@ extension LabelAttributeFontModel: VDSLabelAttributeConvertable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
extension LabelAttributeColorModel: VDSLabelAttributeConvertable {
|
extension LabelAttributeColorModel: VDSLabelAttributeConvertable {
|
||||||
public func convertToVDSLabelAttirbute(delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) -> ColorLabelAttribute? {
|
public func convertToVDSLabelAttribute(delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) -> ColorLabelAttribute? {
|
||||||
guard let textColor else { return nil }
|
guard let textColor else { return nil }
|
||||||
return ColorLabelAttribute(location: location,
|
return ColorLabelAttribute(location: location,
|
||||||
length: length,
|
length: length,
|
||||||
@ -91,14 +91,14 @@ extension LabelAttributeColorModel: VDSLabelAttributeConvertable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
extension LabelAttributeStrikeThroughModel: VDSLabelAttributeConvertable {
|
extension LabelAttributeStrikeThroughModel: VDSLabelAttributeConvertable {
|
||||||
public func convertToVDSLabelAttirbute(delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) -> StrikeThroughLabelAttribute? {
|
public func convertToVDSLabelAttribute(delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) -> StrikeThroughLabelAttribute? {
|
||||||
return StrikeThroughLabelAttribute(location: location,
|
return StrikeThroughLabelAttribute(location: location,
|
||||||
length: length)
|
length: length)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extension LabelAttributeImageModel: VDSLabelAttributeConvertable {
|
extension LabelAttributeImageModel: VDSLabelAttributeConvertable {
|
||||||
public func convertToVDSLabelAttirbute(delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) -> AtomicImageLabelAttribute? {
|
public func convertToVDSLabelAttribute(delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) -> AtomicImageLabelAttribute? {
|
||||||
var frame: CGRect?
|
var frame: CGRect?
|
||||||
if let size {
|
if let size {
|
||||||
frame = CGRect(x: 0, y: 0, width: size, height: size)
|
frame = CGRect(x: 0, y: 0, width: size, height: size)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user