---
title: "CFBundleGetVersionNumber(_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfbundlegetversionnumber(_:)"
---

# CFBundleGetVersionNumber(_:)

Returns a bundle’s version number.

## Declaration

```swift
func CFBundleGetVersionNumber(_ bundle: CFBundle!) -> UInt32
```

## Parameters

- `bundle`: The bundle to examine. The bundle’s version number can be number or a string of the standard form “2.5.3d5”.

## Return Value

Return Value A vers resource style version number. If it is a string, it is automatically converted to the numeric representation, where the major version number is restricted to 2 BCD digits (in other words, it must be in the range 0-99) and the minor and bug fix version numbers are each restricted to a single BCD digit (0-9).

## Discussion

Discussion This function is only supported for the vers resource style version numbers. Where other version number styles—namely X, or X.Y, or X.Y.Z—are used, you can use CFBundleGetValueForInfoDictionaryKey(_:_:) with the key kCFBundleVersionKey to extract the version number as a string from the bundle’s information dictionary. Some version numbers of the form X, X.Y, and X.Y.Z may work with this function, if X <= 99, Y <= 9, and Z <= 9. Thus a version number 76.5.4 will work, but 76.12 will not work.

## See Also

### Getting Bundle Properties

- [CFBundleCopyBundleURL(_:)](corefoundation/cfbundlecopybundleurl(_:).md)
- [CFBundleGetDevelopmentRegion(_:)](corefoundation/cfbundlegetdevelopmentregion(_:).md)
- [CFBundleGetIdentifier(_:)](corefoundation/cfbundlegetidentifier(_:).md)
- [CFBundleGetInfoDictionary(_:)](corefoundation/cfbundlegetinfodictionary(_:).md)
- [CFBundleGetLocalInfoDictionary(_:)](corefoundation/cfbundlegetlocalinfodictionary(_:).md)
- [CFBundleGetValueForInfoDictionaryKey(_:_:)](corefoundation/cfbundlegetvalueforinfodictionarykey(_:_:).md)
- [CFBundleCopyInfoDictionaryInDirectory(_:)](corefoundation/cfbundlecopyinfodictionaryindirectory(_:).md)
- [CFBundleCopyInfoDictionaryForURL(_:)](corefoundation/cfbundlecopyinfodictionaryforurl(_:).md)
- [CFBundleGetPackageInfo(_:_:_:)](corefoundation/cfbundlegetpackageinfo(_:_:_:).md)
- [CFBundleGetPackageInfoInDirectory(_:_:_:)](corefoundation/cfbundlegetpackageinfoindirectory(_:_:_:).md)
- [CFBundleCopyExecutableArchitectures(_:)](corefoundation/cfbundlecopyexecutablearchitectures(_:).md)
- [CFBundleCopyExecutableArchitecturesForURL(_:)](corefoundation/cfbundlecopyexecutablearchitecturesforurl(_:).md)
