<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ObjectiveC",
  "identifier" : "/documentation/ObjectiveC/NSObject-swift.class/KeyValueObservingPublisher/init(object:keyPath:options:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Objective-C Runtime"
    ],
    "preciseIdentifier" : "s:So8NSObjectC10FoundationE26KeyValueObservingPublisherV6object7keyPath7optionsAEy_xq_Gx_s0cI0Cyxq_GSo05NSKeydE7OptionsVtcfc"
  },
  "title" : "init(object:keyPath:options:)"
}
-->

# init(object:keyPath:options:)

Creates a key-value observing publisher for the given combination of object and key path, using publishing behavior options you provide.

```
init(object: Subject, keyPath: KeyPath<Subject, Value>, options: NSKeyValueObservingOptions)
```

## Parameters

`object`

The object that contains the property to publish.

`keyPath`

The key path, relative to the object receiving this message, of the property to publish.

`options`

Options that determine which elements the publisher produces. Set this parameter to `[]` to receive new elements when the observed property changes.

## Discussion

This publisher produces a new element every time the observed property changes.

---

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)