vds_ios/VDS/Components/Tilelet/TileletSubTitleModel.swift
Matt Bruce da1434fdfd added documentaion comments.
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2023-08-28 10:28:53 -05:00

55 lines
2.0 KiB
Swift

//
// TiletSubTitleModel.swift
// VDS
//
// Created by Matt Bruce on 1/6/23.
//
import Foundation
extension Tilelet {
public struct SubTitleModel {
//--------------------------------------------------
// MARK: - Enums
//--------------------------------------------------
public enum StandardStyle: String, EnumSubset {
case bodyLarge
case bodyMedium
case bodySmall
public var defaultValue: TitleLockup.OtherStandardStyle { .bodySmall }
}
//--------------------------------------------------
// MARK: - Public Properties
//--------------------------------------------------
public var text: String = ""
public var standardStyle: StandardStyle = .bodySmall
/// Array of LabelAttributeModel objects used in rendering the text.
public var textAttributes: [any LabelAttributeModel]?
public var textColor: Use = .primary
//--------------------------------------------------
// MARK: - Initializers
//--------------------------------------------------
public init(text: String,
textColor: Use = .primary,
textAttributes: [any LabelAttributeModel]? = nil,
standardStyle: StandardStyle = .bodySmall) {
self.text = text
self.textAttributes = textAttributes
self.textColor = textColor
self.standardStyle = standardStyle
}
//--------------------------------------------------
// MARK: - Public Methods
//--------------------------------------------------
public func toTitleLockupSubTitleModel() -> TitleLockup.SubTitleModel {
TitleLockup.SubTitleModel(text: text,
standardStyle: standardStyle.value,
textColor: textColor,
textAttributes: textAttributes)
}
}
}