65 lines
2.6 KiB
Swift
65 lines
2.6 KiB
Swift
//
|
|
// TiletEyebrowModel.swift
|
|
// VDS
|
|
//
|
|
// Created by Bandaru, Krishna Kishore on 13/03/24.
|
|
//
|
|
|
|
import Foundation
|
|
import UIKit
|
|
|
|
extension Tilelet {
|
|
|
|
/// Model that represents the options available for the eyebrow label.
|
|
public struct EyebrowModel {
|
|
//--------------------------------------------------
|
|
// MARK: - Public Properties
|
|
//--------------------------------------------------
|
|
/// Text that will be used for the eyebrow label.
|
|
public var text: String = ""
|
|
|
|
/// Text color that will be used for the eyebrow label
|
|
public var textColor: TitleLockup.TextColor
|
|
|
|
/// Used in combination with standardStyle to set the textStyle that will be used for the eyebrow label.
|
|
public var isBold: Bool = false
|
|
/// Text attributes that will be used for the eyebrow label.
|
|
public var textAttributes: [any LabelAttributeModel]?
|
|
|
|
/// Text style that will be used for the eyebrow label. If subtitle standard style
|
|
public var standardStyle: Tilelet.SubTitleModel.OtherStandardStyle = .titleSmall
|
|
|
|
/// LineBreakMode used in Badge label.
|
|
public var lineBreakMode: NSLineBreakMode
|
|
|
|
//--------------------------------------------------
|
|
// MARK: - Initializers
|
|
//--------------------------------------------------
|
|
public init(text: String,
|
|
textColor: TitleLockup.TextColor = .primary,
|
|
textAttributes: [any LabelAttributeModel]? = nil,
|
|
isBold: Bool = true,
|
|
standardStyle: Tilelet.SubTitleModel.OtherStandardStyle = .bodySmall,
|
|
lineBreakMode: NSLineBreakMode = .byTruncatingTail) {
|
|
self.text = text
|
|
self.textColor = textColor
|
|
self.textAttributes = textAttributes
|
|
self.standardStyle = standardStyle
|
|
self.isBold = isBold
|
|
self.lineBreakMode = lineBreakMode
|
|
}
|
|
|
|
//--------------------------------------------------
|
|
// MARK: - Public Methods
|
|
//--------------------------------------------------
|
|
/// Converts this type of model to a TitleLockup.TitleModel.
|
|
public func toTitleLockupEyebrowModel() -> TitleLockup.EyebrowModel {
|
|
TitleLockup.EyebrowModel(text: text,
|
|
textColor: textColor,
|
|
isBold: isBold,
|
|
standardStyle: standardStyle.value,
|
|
textAttributes: textAttributes)
|
|
}
|
|
}
|
|
}
|