---
title: "CFBagGetCount(_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfbaggetcount(_:)"
---

# CFBagGetCount(_:)

Returns the number of values currently in a bag.

## Declaration

```swift
func CFBagGetCount(_ theBag: CFBag!) -> CFIndex
```

## Parameters

- `theBag`: The bag to examine.

## Return Value

Return Value The number of values in theBag.

## See Also

### Examining a Bag

- [CFBagContainsValue(_:_:)](corefoundation/cfbagcontainsvalue(_:_:).md)
- [CFBagGetCountOfValue(_:_:)](corefoundation/cfbaggetcountofvalue(_:_:).md)
- [CFBagGetValue(_:_:)](corefoundation/cfbaggetvalue(_:_:).md)
- [CFBagGetValueIfPresent(_:_:_:)](corefoundation/cfbaggetvalueifpresent(_:_:_:).md)
- [CFBagGetValues(_:_:)](corefoundation/cfbaggetvalues(_:_:).md)
