Contents

NSInflectionRule

A rule that affects how an attributed string performs automatic grammatical agreement.

Declaration

@interface NSInflectionRule : NSObject

Overview

Most apps can rely on loading localized strings to perform automatic grammar agreement. Typically, your app’s strings files use the Markdown extension syntax to indicate portions of the string that may require inflection to agree grammatically. This transformation occurs when you load the attributed string with methods like NSLocalizedAttributedString.

However, if the system lacks information about the words in the string, you may need to apply an inflection rule programmatically. For example, a social networking app may have gender information about other users that you want to apply at runtime. When performing manual inflection at runtime, you use an inflection rule to indicate to the system what portions of a string should be automatically edited, and what to match. Add the attribute inflectionRule with an NSInflectionRule on an NSAttributedString, then call inflecting() to perform the grammar agreement and produce an edited string.

Topics

Performing Automatic Inflection

Determining Availability

See Also

Automatic grammar agreement