<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreFoundation",
  "identifier" : "/documentation/CoreFoundation/CFBitVectorSetBits(_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Foundation"
    ],
    "preciseIdentifier" : "c:@F@CFBitVectorSetBits"
  },
  "title" : "CFBitVectorSetBits(_:_:_:)"
}
-->

# CFBitVectorSetBits(_:_:_:)

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

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

[`CFBitVectorGetCount(_:)`](/documentation/CoreFoundation/CFBitVectorGetCount(_:))

Returns the number of bit values in a bit vector.



---

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)