<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HealthKit",
  "identifier" : "/documentation/HealthKit/HKQuantityTypeIdentifier/numberOfAlcoholicBeverages",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "HealthKit"
    ],
    "preciseIdentifier" : "c:@HKQuantityTypeIdentifierNumberOfAlcoholicBeverages"
  },
  "title" : "numberOfAlcoholicBeverages"
}
-->

# numberOfAlcoholicBeverages

A quantity sample type that measures the number of standard alcoholic drinks that the user has consumed.

```
static let numberOfAlcoholicBeverages: HKQuantityTypeIdentifier
```

## Discussion

Samples matching the [`numberOfAlcoholicBeverages`](/documentation/HealthKit/HKQuantityTypeIdentifier/numberOfAlcoholicBeverages) identifier measure the number of standard alcoholic drinks consumed by the user. A standard drink is one beer, glass of wine, or mixed drink made with spirits. The samples use count units (described in [`HKUnit`](/documentation/HealthKit/HKUnit)) to measure cumulative values (described in [`HKQuantityAggregationStyle`](/documentation/HealthKit/HKQuantityAggregationStyle)).

The following code listing saves a single standard drink to the HealthKit store.

```swift
// Create the alcoholic beverage sample type.
let alcoholConsumptionType = HKQuantityType(.numberOfAlcoholicBeverages)

// Create a quantity for the number of standard beverages consumed.
let beverageCount = HKQuantity(unit:HKUnit.count(), doubleValue:1.0)

// Get the current date.
let date = Date()

// Create the alcoholic beverage consumption sample.
let beverageSample = HKQuantitySample(type: alcoholConsumptionType,
                                      quantity: beverageCount,
                                      start: date,
                                      end: date)

// Save the sample to the HealthKit store.
store.save(beverageSample) { (success, error) in
    
    if success {
        // The system successfully saved the sample.
        
    } else {
        if let error = error {
            // Handle the error here.
        }
    }
}
```

---

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)