---
title: eventCounter
framework: swiftdata
role: symbol
role_heading: Instance Property
path: swiftdata/historyobserver/eventcounter
---

# eventCounter

A counter that increments each time the observer detects relevant changes.

## Declaration

```swift
final var eventCounter: Int { get }
```

## Discussion

Discussion The observer increments this value when it processes a remote change notification that contains transactions matching its criteria. You can observe this property from a SwiftUI view to trigger a UI update.

## See Also

### Accessing observer properties

- [modelContainer](swiftdata/historyobserver/modelcontainer.md)
- [observedModels](swiftdata/historyobserver/observedmodels.md)
- [authors](swiftdata/historyobserver/authors.md)
