One Logo Pool Ball
Foundation · IOS API REFERENCE

DiscontiguousAttributedSubstring

struct · iOS 26.0+ · SDK 27.1

@dynamicMemberLookup struct DiscontiguousAttributedSubstring

A discontiguous portion of an attributed string.

Members (9)

get · iOS 26.0+

characters

TypeScript
get characters(): SDKHandle
Swift declaration
var characters: DiscontiguousSlice<AttributedString.CharacterView> { get }

The characters of the discontiguous attributed string, as a view into the underlying string.

get · iOS 26.0+

description

TypeScript
get description(): string
Swift declaration
var description: String { get }

A textual representation of this instance. Calling this property directly is discouraged. Instead, convert an instance of any type to a string by using the `String(describing:)` initializer. This initializer works with any type, and uses the custom `description` property for types that conform to `CustomStringConvertible`: struct Point: CustomStringConvertible { let x: Int, y: Int var description: String { return "(\(x), \(y))" } } let p = Point(x: 21, y: 30) let s = String(describing: p) print(s) // Prints "(21, 30)" The conversion of `p` to a string in the assignment to `s` uses the `Point` type's `description` property.

method · iOS 26.0+

setAttributes

TypeScript
setAttributes(attributes: AttributeContainer): void
Swift declaration
mutating func setAttributes(_ attributes: AttributeContainer)

Sets the attributed string's attributes to those in a specified attribute container. - Parameters: - attributes: The attribute container with the attributes to apply.

get · iOS 26.0+

unicodeScalars

TypeScript
get unicodeScalars(): SDKHandle
Swift declaration
var unicodeScalars: DiscontiguousSlice<AttributedString.UnicodeScalarView> { get }

The Unicode scalars of the discontiguous attributed string, as a view into the underlying string.

method · iOS 26.0+

mergeAttributes

TypeScript
mergeAttributes(attributes: AttributeContainer, mergePolicy?: AttributedString_AttributeMergePolicy): void
Swift declaration
mutating func mergeAttributes(_ attributes: AttributeContainer, mergePolicy: AttributedString.AttributeMergePolicy = .keepNew)

Merges the attributed string's attributes with those in a specified attribute container. - Parameters: - attributes: The attribute container with the attributes to merge. - mergePolicy: A policy to use when resolving conflicts between this string's attributes and those in `attributes`.

method · iOS 26.0+

replaceAttributes

TypeScript
replaceAttributes(attributes: AttributeContainer, others: AttributeContainer): void
Swift declaration
mutating func replaceAttributes(_ attributes: AttributeContainer, with others: AttributeContainer)

Replaces the attributed string's attributes with those in a specified attribute container. - Parameters: - attributes: The existing attributes to replace. - others: The new attributes to apply.

get · iOS 26.0+

base

TypeScript
get base(): AttributedString
Swift declaration
var base: AttributedString { get }

The underlying attributed string that the discontiguous attributed substring derives from.

get · iOS 26.0+

runs

TypeScript
get runs(): AttributedString_Runs
Swift declaration
var runs: AttributedString.Runs { get }

The attributed runs of the discontiguous attributed string, as a view into the underlying string.

subscript · iOS 26.0+

subscript

TypeScript
subscript(bounds: SDKHandle): DiscontiguousAttributedSubstring
Swift declaration
subscript(bounds: RangeSet<AttributedString.Index>) -> DiscontiguousAttributedSubstring { get }

Returns a discontiguous substring of this discontiguous attributed string using a set of ranges to indicate the discontiguous substring bounds. - Parameter bounds: A set of ranges that indicate the bounds of the discontiguous substring to return.

Skipped declarations

4 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

DiscontiguousAttributedSubstring.subscript(_:)

This parameter hides a concrete Swift type.

DiscontiguousAttributedSubstring.subscript(_:)

Passing a Swift type itself is not supported.

DiscontiguousAttributedSubstring.subscript(dynamicMember:)

This declaration needs Swift generic type arguments. (no canonical witness for K)

DiscontiguousAttributedSubstring.subscript(dynamicMember:)

Passing a Swift type itself is not supported.

All Foundation types →