53 lines
1.7 KiB
Swift
53 lines
1.7 KiB
Swift
//
|
|
// TiletTitleModel.swift
|
|
// VDS
|
|
//
|
|
// Created by Matt Bruce on 1/6/23.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
extension Tilet {
|
|
public struct TitleModel: Codable {
|
|
//--------------------------------------------------
|
|
// MARK: - Enums
|
|
//--------------------------------------------------
|
|
public enum TextStyle: String, EnumSubset, Codable {
|
|
case titleXLarge
|
|
case boldTitleXLarge
|
|
case titleLarge
|
|
case boldTitleLarge
|
|
case titleMedium
|
|
case boldTitleMedium
|
|
case titleSmall
|
|
case boldTitleSmall
|
|
|
|
public var defaultValue: TitleLockup.TitleTextStyle { .boldTitleSmall }
|
|
}
|
|
|
|
//--------------------------------------------------
|
|
// MARK: - Public Properties
|
|
//--------------------------------------------------
|
|
public var text: String = ""
|
|
public var textStyle: TextStyle = .boldTitleSmall
|
|
|
|
//--------------------------------------------------
|
|
// MARK: - Initializers
|
|
//--------------------------------------------------
|
|
public init(text: String,
|
|
textStyle: TextStyle = .boldTitleSmall) {
|
|
self.text = text
|
|
self.textStyle = textStyle
|
|
}
|
|
|
|
//--------------------------------------------------
|
|
// MARK: - Public Functions
|
|
//--------------------------------------------------
|
|
public func toTitleLockupTitleModel() -> TitleLockup.TitleModel {
|
|
TitleLockup.TitleModel(text: text,
|
|
textAttributes: nil,
|
|
textStyle: textStyle.value)
|
|
}
|
|
}
|
|
}
|