---
title: CFMutableBag
framework: corefoundation
role: symbol
role_heading: Class
path: corefoundation/cfmutablebag
---

# CFMutableBag

## Declaration

```swift
class CFMutableBag
```

## Overview

Overview CFMutableBag manages dynamic bags. The basic interface for managing bags is provided by CFBag. CFMutableBag adds functions to modify the contents of a bag. You create a mutable bag object using either the CFBagCreateMutable(_:_:_:) or CFBagCreateMutableCopy(_:_:_:) function. CFMutableBag provides several functions for adding and removing values from a bag. The CFBagAddValue(_:_:) function adds a value to a bag and CFBagRemoveValue(_:_:) removes values from a bag.

## Topics

### Creating a Mutable Bag

- [CFBagCreateMutable(_:_:_:)](corefoundation/cfbagcreatemutable(_:_:_:).md)
- [CFBagCreateMutableCopy(_:_:_:)](corefoundation/cfbagcreatemutablecopy(_:_:_:).md)

### Modifying a Mutable Bag

- [CFBagAddValue(_:_:)](corefoundation/cfbagaddvalue(_:_:).md)
- [CFBagRemoveAllValues(_:)](corefoundation/cfbagremoveallvalues(_:).md)
- [CFBagRemoveValue(_:_:)](corefoundation/cfbagremovevalue(_:_:).md)
- [CFBagReplaceValue(_:_:)](corefoundation/cfbagreplacevalue(_:_:).md)
- [CFBagSetValue(_:_:)](corefoundation/cfbagsetvalue(_:_:).md)

## Relationships

### Inherits From

- [CFBag](corefoundation/cfbag.md)

### Conforms To

- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)

## See Also

### Related Documentation

- [Collections Programming Topics for Core Foundation](apple-archive/documentation/CoreFoundation/Conceptual/CFCollections.md)

### Opaque Types

- [CFAllocator](corefoundation/cfallocator.md)
- [CFArray](corefoundation/cfarray.md)
- [CFAttributedString](corefoundation/cfattributedstring.md)
- [CFBag](corefoundation/cfbag.md)
- [CFBinaryHeap](corefoundation/cfbinaryheap.md)
- [CFBitVector](corefoundation/cfbitvector.md)
- [CFBoolean](corefoundation/cfboolean.md)
- [CFBundle](corefoundation/cfbundle.md)
- [CFCalendar](corefoundation/cfcalendar.md)
- [CFCharacterSet](corefoundation/cfcharacterset.md)
- [CFData](corefoundation/cfdata.md)
- [CFDate](corefoundation/cfdate.md)
- [CFDateFormatter](corefoundation/cfdateformatter.md)
- [CFDictionary](corefoundation/cfdictionary.md)
- [CFError](corefoundation/cferror.md)
