---
title: "integerValue(asTypeTruncatingIfNeeded:)"
framework: corehid
role: symbol
role_heading: Instance Method
path: "corehid/hidelement/value/integervalue(astypetruncatingifneeded:)"
---

# integerValue(asTypeTruncatingIfNeeded:)

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

## Declaration

```swift
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.

## Mentioned in

Communicating with human interface devices

## Return Value

Return Value The data cast as the requested type.

## See Also

### Get element data and values

- [bytes](corehid/hidelement/value/bytes.md)
- [logicalValue(asTypeTruncatingIfNeeded:)](corehid/hidelement/value/logicalvalue(astypetruncatingifneeded:).md)
- [physicalValue(fromTypeTruncatingIfNeeded:as:)](corehid/hidelement/value/physicalvalue(fromtypetruncatingifneeded:as:).md)
- [timestamp](corehid/hidelement/value/timestamp.md)
