---
title: "init(object:keyPath:options:)"
framework: objectivec
role: symbol
role_heading: Initializer
path: "objectivec/nsobject-swift.class/keyvalueobservingpublisher/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.

## Declaration

```swift
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

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