---
title: HKMetadataKeySexualActivityProtectionUsed
framework: healthkit
role: symbol
role_heading: Global Variable
path: healthkit/hkmetadatakeysexualactivityprotectionused
---

# HKMetadataKeySexualActivityProtectionUsed

A key that indicates whether protection was used during sexual activity. This metadata key can be used with sexualActivity category samples.

## Declaration

```swift
let HKMetadataKeySexualActivityProtectionUsed: String
```

## Discussion

Discussion Set this key’s value to true if protection was used during sexual activity; otherwise, set it to false.
