vds_ios/VDS/Components/TitleLockup/TitleLockupSubTitleModel.swift
Matt Bruce 4685c6d398 Implemented TextColor changes to TitleLockup
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2024-05-06 16:42:12 -05:00

52 lines
1.7 KiB
Swift

//
// TitleLockupSubTitleModel.swift
// VDS
//
// Created by Matt Bruce on 1/6/23.
//
import Foundation
import UIKit
extension TitleLockup {
/// Model that represents the options available for the sub title label.
public struct SubTitleModel {
/// Text that will be used for the subTitle label.
public var text: String
/// Standard style that will be used for the subTitle label.
public var otherStandardStyle: OtherStandardStyle
/// Text color used in the subtitle label.
public var textColor: TextColor
/// Array of LabelAttributeModel objects used in rendering the text in the subtitle label.
public var textAttributes: [any LabelAttributeModel]?
/// Number of lines used in the subtitle label.
public var numberOfLines: Int
/// LineBreakMode used in subtitle label.
public var lineBreakMode: NSLineBreakMode
public init(text: String,
otherStandardStyle: OtherStandardStyle = .bodyLarge,
textColor: TextColor = .primary,
textAttributes: [any LabelAttributeModel]? = nil,
numberOfLines: Int = 0,
lineBreakMode: NSLineBreakMode = .byWordWrapping) {
self.text = text
self.otherStandardStyle = otherStandardStyle
self.textColor = textColor
self.textAttributes = textAttributes
self.numberOfLines = numberOfLines
self.lineBreakMode = lineBreakMode
}
/// TextStyle used to render the text.
public var textStyle: TextStyle { otherStandardStyle.value.regular }
}
}