(144239125) Re-add existing SPI for enumerating NSAttributedString.Key runs (#1162)

This commit is contained in:
Jeremy Schonfeld 2025-02-05 15:12:28 -08:00 committed by GitHub
parent 1dc45d374d
commit 74275a96e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -781,6 +781,11 @@ extension AttributedString.Runs {
} }
} }
@_spi(AttributedString)
public subscript(nsAttributedStringKeys keys: NSAttributedString.Key...) -> NSAttributesSlice {
self[nsAttributedStringKeys: keys]
}
@_spi(AttributedString) @_spi(AttributedString)
public subscript(nsAttributedStringKeys keys: [NSAttributedString.Key]) -> NSAttributesSlice { public subscript(nsAttributedStringKeys keys: [NSAttributedString.Key]) -> NSAttributesSlice {
return NSAttributesSlice(runs: self, names: keys.map { $0.rawValue }) return NSAttributesSlice(runs: self, names: keys.map { $0.rawValue })