vds_ios/VDS/Components/TitleLockup/TitleLockupSubTitleModel.swift
2024-03-07 14:02:39 +05:30

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: Use
/// 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: Use = .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 }
}
}