---
title: "init(from:)"
framework: swift
role: symbol
role_heading: Initializer
path: "swift/rawrepresentable/init(from:)-29lhi"
---

# init(from:)

Creates a new instance by decoding from the given decoder, when the type’s RawValue is Int64.

## Declaration

```swift
init(from decoder: any Decoder) throws
```

## Parameters

- `decoder`: The decoder to read data from.

## Discussion

Discussion This initializer throws an error if reading from the decoder fails, or if the data read is corrupted or otherwise invalid.

## See Also

### Decoding a Value

- [init(from:)](swift/rawrepresentable/init(from:)-5auil.md)
- [init(from:)](swift/rawrepresentable/init(from:)-5ar5m.md)
- [init(from:)](swift/rawrepresentable/init(from:)-417i8.md)
- [init(from:)](swift/rawrepresentable/init(from:)-9u9tp.md)
- [init(from:)](swift/rawrepresentable/init(from:)-4ibll.md)
- [init(from:)](swift/rawrepresentable/init(from:)-3hvw1.md)
- [init(from:)](swift/rawrepresentable/init(from:)-5ktev.md)
- [init(from:)](swift/rawrepresentable/init(from:)-2hvc0.md)
- [init(from:)](swift/rawrepresentable/init(from:)-114vz.md)
- [init(from:)](swift/rawrepresentable/init(from:)-94955.md)
- [init(from:)](swift/rawrepresentable/init(from:)-6z4x4.md)
- [init(from:)](swift/rawrepresentable/init(from:)-3arr3.md)
- [init(from:)](swift/rawrepresentable/init(from:)-812cy.md)
