One Logo Pool Ball
Foundation · IOS API REFERENCE

AttributeScopes.FoundationAttributes.InflectionAlternativeAttribute

enum · iOS 15.0+ · SDK 27.1

@frozen enum InflectionAlternativeAttribute

An attribute that provides an alternative inflection phrase when the system can't achieve grammatical agreement. Use this attribute to provide an alternative phrase for cases where the system can't achieve unambiguous grammatical agreement. For example, when inflecting a gendered word without knowing the person's preferred terms of address, you can set an `inflectionAlternative` to supply a gender-neutral fallback: ```swift let resource = LocalizedStringResource( "^[Bienvenido](inflect: true, inflectionAlternative: 'Te damos la bienvenida').") let result = AttributedString(localized: resource) // result == "Te damos la bienvenida." ```

Members (5)

get · iOS 15.0+

markdownName

TypeScript
static get markdownName(): string
Swift declaration
static let markdownName: String

The Markdown name associated with an attributed string key.

static · iOS 15.0+

decodeMarkdown

TypeScript
static decodeMarkdown(decoder: SDKHandle): AttributedString
Swift declaration
static func decodeMarkdown(from decoder: any Decoder) throws -> AttributedString

Decodes a value from the provided decoder. This method throws an error if reading from the decoder fails, or if the data read is corrupted or otherwise invalid. - Parameter decoder: The decoder to read data from. - Returns: The decoded value.

static · iOS 15.0+

objectiveCValue

TypeScript
static objectiveCValue(value: AttributedString): _ObjectiveC_NSObject
Swift declaration
static func objectiveCValue(for value: AttributedString) throws -> NSObject

Returns an Objective-C typed value for a given value of this key's type. - Parameter value: The value to convert. - Returns: `value`, expressed as the Objective-C type defined by ``ObjectiveCConvertibleAttributedStringKey/ObjectiveCValue``.

get · iOS 15.0+

name

TypeScript
static get nameValue(): string
Swift declaration
static let name: String

The name of the key.

static · iOS 15.0+

value

TypeScript
static value(object: _ObjectiveC_NSObject): AttributedString
Swift declaration
static func value(for object: NSObject) throws -> AttributedString

Returns a value of this key's type for a given Objective-C value. - Parameter object: The Objective-C value to convert. - Returns: `object`, expressed as this key's type.

Skipped declarations

No declarations were skipped in this snapshot.

All Foundation types →