---
title: ForegroundTerminationMetric
framework: metrickit
role: symbol
role_heading: Structure
path: metrickit/foregroundterminationmetric
---

# ForegroundTerminationMetric

A metric that counts app terminations from the foreground by category.

## Declaration

```swift
struct ForegroundTerminationMetric
```

## Discussion

Discussion This metric corresponds to the MetricResult.foregroundTermination(_:) case. It appears in both intervalEntries and stateEntries when state reporting is enabled. Foreground exits are user-visible terminations; when unexpected, they directly interrupt usage. Not all exits are unexpected — normal exits such as the user quitting the app from the switcher appear in normalTerminationCount. Use terminationCategory to correlate individual crash diagnostics with these aggregate counts. This type replaces the foregroundExitData property of MXAppExitMetric.

## Topics

### Foreground termination counts

- [normalTerminationCount](metrickit/foregroundterminationmetric/normalterminationcount.md)
- [memoryLimitTerminationCount](metrickit/foregroundterminationmetric/memorylimitterminationcount.md)
- [badAccessTerminationCount](metrickit/foregroundterminationmetric/badaccessterminationcount.md)
- [abnormalTerminationCount](metrickit/foregroundterminationmetric/abnormalterminationcount.md)
- [illegalInstructionTerminationCount](metrickit/foregroundterminationmetric/illegalinstructionterminationcount.md)
- [watchdogTerminationCount](metrickit/foregroundterminationmetric/watchdogterminationcount.md)

## Relationships

### Conforms To

- [Decodable](swift/decodable.md)
- [Encodable](swift/encodable.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Termination metrics

- [BackgroundTerminationMetric](metrickit/backgroundterminationmetric.md)
