Instance Method インスタンスメソッド

annotatedString(from:)

Returns an attributed string formatted for a given NSPersonNameComponents object, with attribute annotations for each component. ある書式設定された属性付き文字列を、ある与えられたNSPersonNameComponentsオブジェクトに対して返します、各構成要素に対して属性注釈をもちます。

Declaration 宣言

func annotatedString(from components: PersonNameComponents) -> NSAttributedString

Parameters パラメータ

components

A formatted string representation of the given name components. 与えられた名前構成要素の書式設定された文字列表現。

Return Value 戻り値

An attributed string representation of the given name components. You can determine the person component corresponding to a particular range of the attributed string by querying the NSPersonNameComponentKey attribute, providing one of the NSPersonNameComponent constant values defined below as the attribute value. 与えられた名前構成要素それらからなるある属性付き文字列表現。あなたは、属性付き文字列の特定の範囲に対応するperson構成要素を決定することが可能です、NSPersonNameComponentKey属性について問いただすことによって、下で定義されるNSPersonNameComponent定数値の1つを属性値として提供して。

Discussion 議論

Use this method to style individual components of a formatted name, such as a name in a label. このメソッドを使って、ある書式設定された名前の個々の構成要素、例えばあるラベルの中のある名前などの体裁を整えてください。

See Also 参照

Converting Between Person Name Components and Strings 個人名構成要素と文字列の間で変換する