---
title: "init(repeating:count:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/data/init(repeating:count:)"
---

# init(repeating:count:)

Initialize a Data with a repeating byte pattern

## Declaration

```swift
init(repeating repeatedValue: UInt8, count: Int)
```

## Parameters

- `repeatedValue`: A byte to initialize the pattern
- `count`: The number of bytes the data initially contains initialized to the repeatedValue
