<!--
{
  "availability" : [
    "macOS: 15.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreHID",
  "identifier" : "/documentation/CoreHID/HIDElement/Value/integerValue(asTypeTruncatingIfNeeded:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core HID",
      "CoreHID"
    ],
    "preciseIdentifier" : "s:7CoreHID10HIDElementV5ValueV07integerD024asTypeTruncatingIfNeededxxm_ts17FixedWidthIntegerRzlF"
  },
  "title" : "integerValue(asTypeTruncatingIfNeeded:)"
}
-->

# integerValue(asTypeTruncatingIfNeeded:)

The raw value of the data cast as an integer type, with no transformations applied.

```
func integerValue<IntegerType>(asTypeTruncatingIfNeeded: IntegerType.Type) -> IntegerType where IntegerType : FixedWidthInteger
```

## Parameters

`asTypeTruncatingIfNeeded`

The type to which to cast the underlying bytes, truncating or extending the bytes as necessary.

## Return Value

The data cast as the requested type.

---

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)