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

bind(_:to:withKeyPath:options:)

Establishes a binding between a given property of the receiver and the property of a given object specified by a given key path.

Declaration 宣言

func bind(_ binding: NSBindingName, 
       to observable: Any, 
withKeyPath keyPath: String, 
  options: [NSBindingOption : Any]? = nil)

Parameters パラメータ

binding

The key path for a property of the receiver previously exposed using the exposeBinding(_:) method.

observableController

The bound-to object.

keyPath

A key path to a property reachable from observableController. The elements in the path must be key-value observing compliant (see Key-Value Observing Programming Guide).

options オプション

A dictionary containing options for the binding, such as placeholder objects or an NSValueTransformer identifier as described in Constants. This value is optional—pass nil to specify no options.

See Also 参照

Managing bindings