<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "ObjectiveC",
  "identifier" : "/documentation/ObjectiveC/NSObject-swift.class/bind(_:to:withKeyPath:options:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Objective-C Runtime",
      "ObjectiveC"
    ],
    "preciseIdentifier" : "c:objc(cs)NSObject(im)bind:toObject:withKeyPath:options:"
  },
  "title" : "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.

```
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(_:)`](/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 [Key-Value Observing Programming Guide](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.

## Discussion

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)