title: Get Cocoa Touch Framework project version string in Swift
body: <p>Cocoa Touch Frameworks provide support for versioning, which can be found in <strong>Build Settings</strong> under the <strong>Versioning</strong> section.</p>
  
  <p>To access this value at runtime, we can use the <code>FrameworkVersionNumber</code> and <code>FrameworkVersionString[]</code> variables which are auto-generated for us as part of the build process.</p>
  
  <p>When working with a Swift project, these can be found auto-generated at the top of the Objective-C compatibility header:</p>
  
  <pre><code>//! Project version number for Framework.
  FOUNDATION_EXPORT double FrameworkVersionNumber;
  
  //! Project version string for Framework.
  FOUNDATION_EXPORT const unsigned char FrameworkVersionString[];
  </code></pre>
  
  <p>However, whilst <code>FrameworkVersionNumber</code> is accessible from Swift, <code>FrameworkVersionString[]</code> is not. In fact looking at the contents of the framework module, I can see that only the first variable is exposed to Swift:</p>
  
  <pre><code>//! Project version number for Framework.
  var FrameworkVersionNumber: Double
  </code></pre>
  
  <p>The problem with this is that since <code>FrameworkVersionNumber</code> is a <code>Double</code>, any version numbers like 3.2.1 simply get changed to 3.200000...</p>
  
  <p>Does anyone know whether this is a flaw in my project setup, a bug in Xcode, or whether there is a way of getting the framework version in Swift as a <code>String</code> or array, so that I can provide more granular versioning than <em>major.minor</em>?</p>