vds_ios/VDS/Components/Label/Attributes/LabelAttributeStrikeThrough.swift
Matt Bruce 378802eb5e updated to equalSelf
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2022-09-15 16:50:21 -05:00

31 lines
841 B
Swift

//
// LabelAttributeStrikeThrough.swift
// VDS
//
// Created by Matt Bruce on 8/3/22.
//
import Foundation
import UIKit
public struct LabelAttributeStrikeThrough: LabelAttributeModel {
public func isEqualSelf(_ equatable: LabelAttributeStrikeThrough) -> Bool {
return id == equatable.id
&& range == equatable.range
}
public var id = UUID()
public var location: Int
public var length: Int
public init(location: Int, length: Int) {
self.location = location
self.length = length
}
public func setAttribute(on attributedString: NSMutableAttributedString) {
attributedString.addAttribute(.strikethroughStyle, value: NSUnderlineStyle.thick.rawValue, range: range)
attributedString.addAttribute(.baselineOffset, value: 0, range: range)
}
}