vds_ios/VDS/Extensions/NSAttributedString.swift
Matt Bruce f99a3033d6 refactored TextLinkCaret spacer/name label attribute
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2023-05-30 10:05:23 -05:00

20 lines
502 B
Swift

//
// NSAttributedString.swift
// VDS
//
// Created by Matt Bruce on 5/30/23.
//
import Foundation
import UIKit
extension NSAttributedString {
public static func spacer(for width: CGFloat) -> NSAttributedString {
let spacerImage = UIImage()
let spacerAttachment = NSTextAttachment()
spacerAttachment.bounds = .init(x: 0, y: 0, width: width, height: 1)
spacerAttachment.image = spacerImage
return NSAttributedString(attachment: spacerAttachment)
}
}