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

willChange(_:valuesAt:forKey:)

Informs the observed object that the specified change is about to be executed at given indexes for a specified ordered to-many relationship.

Declaration 宣言

func willChange(_ changeKind: NSKeyValueChange, 
       valuesAt indexes: IndexSet, 
         forKey key: String)

Parameters パラメータ

change

The type of change that is about to be made.

indexes

The indexes of the to-many relationship that will be affected by the change.

key

The name of a property that is an ordered to-many relationship.

Discussion 解説

Use this method when implementing key-value-observing compliance manually.

Special Considerations 特別な注意事項

You rarely need to override this method in subclasses, but if you do, be sure to call super.

See Also 参照

Notifying Observers of Changes