StructureFoundation5.9.0
AttributedString
- iOS
- 15+
- macOS
- 12+
- tvOS
- 15+
- watchOS
- 8+
@dynamicMemberLookup struct AttributedString
Citizens in Foundation
Conformances
protocol AttributedStringAttributeMutation
protocol AttributedStringProtocol
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Decodable
A type that can decode itself from an external representation.
protocol DecodableWithConfiguration
protocol Encodable
A type that can encode itself to an external representation.
protocol EncodableWithConfiguration
protocol Equatable
A type that can be compared for value equality.
protocol ExpressibleByExtendedGraphemeClusterLiteral
A type that can be initialized with a string literal containing a single extended grapheme cluster.
protocol ExpressibleByStringLiteral
A type that can be initialized with a string literal.
protocol ExpressibleByUnicodeScalarLiteral
A type that can be initialized with a string literal containing a single Unicode scalar value.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.
Members
init(
) init(NSAttributedString
) init(AttributedSubstring
) init(String, attributes: AttributeContainer
) Creates a new attributed string with the given
String
value associated with the given attributes.init(Substring, attributes: AttributeContainer
) Creates a new attributed string with the given
Substring
value associated with the given attributes.init<S>(S, attributes: AttributeContainer
) init<S, T>(T, including: KeyPath<AttributeScopes, S.Type>
) init<S, T>(T, including: S.Type
) init<S>(NSAttributedString, including: KeyPath<AttributeScopes, S.Type>
) throws init<S>(NSAttributedString, including: S.Type
) throws init(from: Decoder
) throws init(from: Decoder, configuration: AttributeScopeCodableConfiguration
) throws init(stringLiteral: String
) var characters: AttributedString.CharacterView
var endIndex: AttributedString.Index
var runs: AttributedString.Runs
var startIndex: AttributedString.Index
var unicodeScalars: AttributedString.UnicodeScalarView
subscript<K>(K
.Type) -> K.Value? subscript<R>(R
) -> AttributedSubstring subscript<K>(dynamicMember _: KeyPath<AttributeDynamicLookup, K>
) -> K.Value? subscript<S>(dynamicMember _: KeyPath<AttributeScopes, S.Type>
) -> ScopedAttributeContainer<S> static func + (AttributedString, AttributedString
) -> AttributedString static func + <T>(AttributedString, T
) -> AttributedString static func += (inout AttributedString, AttributedString
) static func += <T>(inout AttributedString, T
) static func == (AttributedString, AttributedString
) -> Bool func append<S>(S
) func encode(to: Encoder
) throws func encode(to: Encoder, configuration: AttributeScopeCodableConfiguration
) throws func insert<S>(S, at: AttributedString.Index
) func mergeAttributes(AttributeContainer, mergePolicy: AttributedString.AttributeMergePolicy
) func removeSubrange<R>(R
) func replaceAttributes(AttributeContainer, with: AttributeContainer
) func replaceSubrange<R, S>(R, with: S
) func setAttributes(AttributeContainer
) func transformingAttributes<K>(KeyPath
<AttributeDynamicLookup, K>, (inout AttributedString.SingleAttributeTransformer<K>) -> Void) -> AttributedString func transformingAttributes<K>(K
.Type, (inout AttributedString.SingleAttributeTransformer<K>) -> Void) -> AttributedString func transformingAttributes<K1, K2>(KeyPath
<AttributeDynamicLookup, K1>, KeyPath<AttributeDynamicLookup, K2>, (inout AttributedString.SingleAttributeTransformer<K1>, inout AttributedString.SingleAttributeTransformer<K2>) -> Void) -> AttributedString func transformingAttributes<K1, K2>(K1
.Type, K2.Type, (inout AttributedString.SingleAttributeTransformer<K1>, inout AttributedString.SingleAttributeTransformer<K2>) -> Void) -> AttributedString func transformingAttributes<K1, K2, K3>(KeyPath
<AttributeDynamicLookup, K1>, KeyPath<AttributeDynamicLookup, K2>, KeyPath<AttributeDynamicLookup, K3>, (inout AttributedString.SingleAttributeTransformer<K1>, inout AttributedString.SingleAttributeTransformer<K2>, inout AttributedString.SingleAttributeTransformer<K3>) -> Void) -> AttributedString func transformingAttributes<K1, K2, K3>(K1
.Type, K2.Type, K3.Type, (inout AttributedString.SingleAttributeTransformer<K1>, inout AttributedString.SingleAttributeTransformer<K2>, inout AttributedString.SingleAttributeTransformer<K3>) -> Void) -> AttributedString func transformingAttributes<K1, K2, K3, K4>(KeyPath
<AttributeDynamicLookup, K1>, KeyPath<AttributeDynamicLookup, K2>, KeyPath<AttributeDynamicLookup, K3>, KeyPath<AttributeDynamicLookup, K4>, (inout AttributedString.SingleAttributeTransformer<K1>, inout AttributedString.SingleAttributeTransformer<K2>, inout AttributedString.SingleAttributeTransformer<K3>, inout AttributedString.SingleAttributeTransformer<K4>) -> Void) -> AttributedString func transformingAttributes<K1, K2, K3, K4>(K1
.Type, K2.Type, K3.Type, K4.Type, (inout AttributedString.SingleAttributeTransformer<K1>, inout AttributedString.SingleAttributeTransformer<K2>, inout AttributedString.SingleAttributeTransformer<K3>, inout AttributedString.SingleAttributeTransformer<K4>) -> Void) -> AttributedString func transformingAttributes<K1, K2, K3, K4, K5>(KeyPath
<AttributeDynamicLookup, K1>, KeyPath<AttributeDynamicLookup, K2>, KeyPath<AttributeDynamicLookup, K3>, KeyPath<AttributeDynamicLookup, K4>, KeyPath<AttributeDynamicLookup, K5>, (inout AttributedString.SingleAttributeTransformer<K1>, inout AttributedString.SingleAttributeTransformer<K2>, inout AttributedString.SingleAttributeTransformer<K3>, inout AttributedString.SingleAttributeTransformer<K4>, inout AttributedString.SingleAttributeTransformer<K5>) -> Void) -> AttributedString func transformingAttributes<K1, K2, K3, K4, K5>(K1
.Type, K2.Type, K3.Type, K4.Type, K5.Type, (inout AttributedString.SingleAttributeTransformer<K1>, inout AttributedString.SingleAttributeTransformer<K2>, inout AttributedString.SingleAttributeTransformer<K3>, inout AttributedString.SingleAttributeTransformer<K4>, inout AttributedString.SingleAttributeTransformer<K5>) -> Void) -> AttributedString enum AttributeMergePolicy
struct CharacterView
struct Index
struct Runs
struct SingleAttributeTransformer
struct UnicodeScalarView
Features
var description: String
var halfWidthCornerQuoted: String
static func != (Self, Self
) -> Bool static func == <RHS>(Self, RHS
) -> Bool func hash(into: inout Hasher
) func index(AttributedString
.Index, offsetByCharacters: Int) -> AttributedString.Index func index(AttributedString
.Index, offsetByRuns: Int) -> AttributedString.Index func index(AttributedString
.Index, offsetByUnicodeScalars: Int) -> AttributedString.Index func index(afterCharacter: AttributedString.Index
) -> AttributedString.Index func index(afterRun: AttributedString.Index
) -> AttributedString.Index func index(afterUnicodeScalar: AttributedString.Index
) -> AttributedString.Index func index(beforeCharacter: AttributedString.Index
) -> AttributedString.Index func index(beforeRun: AttributedString.Index
) -> AttributedString.Index func index(beforeUnicodeScalar: AttributedString.Index
) -> AttributedString.Index func mergingAttributes(AttributeContainer, mergePolicy: AttributedString.AttributeMergePolicy
) -> AttributedString func range<T>(of: T, options: String.CompareOptions, locale: Locale?
) -> Range<AttributedString.Index>? func replacingAttributes(AttributeContainer, with: AttributeContainer
) -> AttributedString func settingAttributes(AttributeContainer
) -> AttributedString