vds_ios/VDS/Components/Tilelet/TileletBadgeModel.swift
Matt Bruce aa013f62e3 added equatable to structs
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2024-08-26 09:03:17 -05:00

43 lines
1.3 KiB
Swift

//
// TiletBadgeModel.swift
// VDS
//
// Created by Matt Bruce on 1/6/23.
//
import Foundation
import UIKit
extension Tilelet {
/// Model that represents the options available for the badge.
public struct BadgeModel: Equatable {
/// Text that will be used for the badge.
public var text: String = ""
/// Fill color that will be used for the badge.
public var fillColor: Badge.FillColor
/// Current Surface and this is used to pass down to child objects that implement Surfacable
public var surface: Surface
/// Number of lines that will be used for the badge.
public var numberOfLines: Int
/// Max width that will be used for the badge.
public var maxWidth: CGFloat?
/// LineBreakMode used in Badge label.
public var lineBreakMode: NSLineBreakMode
public init(text: String, fillColor: Badge.FillColor = .red, surface: Surface = .light, numberOfLines: Int = 0, maxWidth: CGFloat? = nil, lineBreakMode: NSLineBreakMode = .byTruncatingTail) {
self.text = text
self.fillColor = fillColor
self.surface = surface
self.numberOfLines = numberOfLines
self.maxWidth = maxWidth
self.lineBreakMode = lineBreakMode
}
}
}