<!--
{
  "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",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Objective-C Runtime",
      "ObjectiveC"
    ],
    "preciseIdentifier" : "s:So8NSObjectC10FoundationE26KeyValueObservingPublisherV"
  },
  "title" : "NSObject.KeyValueObservingPublisher"
}
-->

# NSObject.KeyValueObservingPublisher

A Combine publisher that produces a new element whenever the observed value changes.

```
struct KeyValueObservingPublisher<Subject, Value> where Subject : NSObject
```

## Overview

Use this publisher to integrate a property that’s compliant with key-value observing into a Combine publishing chain. You can create a publisher of this type with the [`NSObject`](/documentation/ObjectiveC/NSObject-swift.class) instance method `publisher(for:options:)`, passing in the key path and a set of <doc://com.apple.documentation/documentation/Foundation/NSKeyValueObservingOptions>.

## Topics

### Creating a KVO Publisher

[`init(object:keyPath:options:)`](/documentation/ObjectiveC/NSObject-swift.class/KeyValueObservingPublisher/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.

### Inspecting KVO Publisher Properties

[`object`](/documentation/ObjectiveC/NSObject-swift.class/KeyValueObservingPublisher/object)

The object that contains the property to publish.

[`keyPath`](/documentation/ObjectiveC/NSObject-swift.class/KeyValueObservingPublisher/keyPath)

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

[`options`](/documentation/ObjectiveC/NSObject-swift.class/KeyValueObservingPublisher/options)

Options that determine which elements the publisher produces.

## Relationships

### Conforms To

[`Copyable`](/documentation/Swift/Copyable)

[`Equatable`](/documentation/Swift/Equatable)

[`Escapable`](/documentation/Swift/Escapable)

[`Publisher`](/documentation/Combine/Publisher)

---

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)