20 lines
502 B
Swift
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)
|
|
}
|
|
}
|