Files
divkit/client/ios/LayoutKit/Interface/RunWithBoundsAttribute.swift
babaevmm 5ea5e7ff05 support text range mask
commit_hash:1d250d40d05dc6aeff067c1e03aff9dc9b37bab2
2025-08-25 14:39:25 +03:00

21 lines
562 B
Swift

import CoreGraphics
import Foundation
public final class RunWithBoundsAttribute {
public static let Key = NSAttributedString.Key("DKActions")
public let actions: [UserInterfaceAction]
public let mask: TextMask?
public init(actions: [UserInterfaceAction], mask: TextMask?) {
self.actions = actions
self.mask = mask
}
public func apply(to str: CFMutableAttributedString, at range: CFRange) {
if !actions.isEmpty || mask != nil {
CFAttributedStringSetAttribute(str, range, RunWithBoundsAttribute.Key as CFString, self)
}
}
}