---
title: "CFBitVectorSetBits(_:_:_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfbitvectorsetbits(_:_:_:)"
---

# CFBitVectorSetBits(_:_:_:)

Sets a range of bits in a bit vector to a particular value.

## Declaration

```swift
func CFBitVectorSetBits(_ bv: CFMutableBitVector!, _ range: CFRange, _ value: CFBit)
```

## Parameters

- `bv`: The bit vector to modify.
- `range`: The range of bits to set. The range must not exceed 0…N-1, where N is the count of the vector.
- `value`: The bit value to which to set the range of bits.

## See Also

### Related Documentation

- [CFBitVectorGetCount(_:)](corefoundation/cfbitvectorgetcount(_:).md)

### Modifying a Bit Vector

- [CFBitVectorFlipBitAtIndex(_:_:)](corefoundation/cfbitvectorflipbitatindex(_:_:).md)
- [CFBitVectorFlipBits(_:_:)](corefoundation/cfbitvectorflipbits(_:_:).md)
- [CFBitVectorSetAllBits(_:_:)](corefoundation/cfbitvectorsetallbits(_:_:).md)
- [CFBitVectorSetBitAtIndex(_:_:_:)](corefoundation/cfbitvectorsetbitatindex(_:_:_:).md)
- [CFBitVectorSetCount(_:_:)](corefoundation/cfbitvectorsetcount(_:_:).md)
