---
title: "bind(_:to:withKeyPath:options:)"
framework: objectivec
role: symbol
role_heading: Instance Method
path: "objectivec/nsobject-swift.class/bind(_:to:withkeypath:options:)"
---

# 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

```swift
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 doc://com.apple.objectivec/documentation/ObjectiveC/NSObject-swift.class/exposeBinding(_:) method.
- `observable`: 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 https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/KeyValueObserving/KeyValueObserving.html#//apple_ref/doc/uid/10000177i).
- `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

- [valueClassForBinding(_:)](objectivec/nsobject-swift.class/valueclassforbinding(_:).md)
- [optionDescriptionsForBinding(_:)](objectivec/nsobject-swift.class/optiondescriptionsforbinding(_:).md)
- [infoForBinding(_:)](objectivec/nsobject-swift.class/infoforbinding(_:).md)
- [NSBindingInfoKey](appkit/nsbindinginfokey.md)
- [unbind(_:)](objectivec/nsobject-swift.class/unbind(_:).md)
- [NSIsControllerMarker(_:)](appkit/nsiscontrollermarker(_:).md)
