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

editingString(for:)

The default implementation of this method invokes string(for:). このメソッドの省略時の実装は、string(for:)を発動します。

Declaration 宣言

func editingString(for obj: Any) -> String?

Parameters パラメータ

anObject

The object for which to return an editing string. それに対して編集する文字列を返すことになるオブジェクト。

Return Value 戻り値

An NSString object that is used for editing the textual representation of anObject. NSStringオブジェクト、それはanObjectのテキスト表現を編集するために使われます。

Discussion 議論

When implementing a subclass, override this method only when the string that users see and the string that they edit are different. In your implementation, return an NSString object that is used for editing, following the logic recommended for implementing string(for:). As an example, you would implement this method if you want the dollar signs in displayed strings removed for editing. サブクラスを実装する場合、ユーザが見る文字列と彼らが編集する文字列とが異なる場合にのみ、このメソッドをオーバーライドしてください。あなたの実装では、編集に使われるNSStringオブジェクトを、string(for:)の実装に勧められる論理に従って、返してください。一例として、あなたが表示文字列でのドル符号を編集作業のため除去したいならば、あなたはこのメソッドを実装するでしょう。

See Also 参照

Getting Textual Representations of Object Values オブジェクト値のテキスト表現を得る