title: Swift random float between 0 and 1
body: <p>In Swift, I'm trying to get a random float between 0 and 1 but I can't seem to get the type conversions to work.</p>
  
  <pre><code>func randomCGFloat() -&gt; CGFloat {
      return CGFloat(arc4random()) / UINT32_MAX
  }
  </code></pre>
  
  <p>I'm getting a 'CGFloat' is not convertible to 'UInt8' error</p>
  
  <p>Running Xcode 6.</p>