<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreFoundation",
  "identifier" : "/documentation/CoreFoundation/CFMutableBitVector",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Core Foundation"
    ],
    "preciseIdentifier" : "c:@T@CFMutableBitVectorRef"
  },
  "title" : "CFMutableBitVector"
}
-->

# CFMutableBitVector

```
class CFMutableBitVector
```

## Overview

CFMutableBitVector objects manage dynamic bit vectors. The basic interface for managing bit vectors is provided by [`CFBitVector`](/documentation/CoreFoundation/CFBitVector). CFMutableBitVector adds functions to modify the contents of a bit vector.

You create a mutable bit vector object using either the [`CFBitVectorCreateMutable(_:_:)`](/documentation/CoreFoundation/CFBitVectorCreateMutable(_:_:)) or [`CFBitVectorCreateMutableCopy(_:_:_:)`](/documentation/CoreFoundation/CFBitVectorCreateMutableCopy(_:_:_:)) function. You add to and remove from a bit vector by altering the size of the bit vector with the [`CFBitVectorSetCount(_:_:)`](/documentation/CoreFoundation/CFBitVectorSetCount(_:_:)) function

## Topics

### Creating a CFMutableBitVector Object

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

Creates a mutable bit vector.

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

Creates a new mutable bit vector from a pre-existing bit vector.

### Modifying a Bit Vector

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

Flips a bit value in a bit vector.

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

Flips a range of bit values in a bit vector.

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

Sets all bits in a bit vector to a particular value.

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

Sets the value of a particular bit in a bit vector.

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

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

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

Changes the size of a mutable 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)