title: ‘CGFloat’ is not convertible to ‘UInt8' and other CGFloat issues with Swift and Xcode 6 beta 4
body: <p>In case this illuminates the problem, here's the original Objective-C code.</p>
  
  <pre><code>int x = (arc4random()%(int)(self.gameView.bounds.size.width*5)) - (int)self.gameView.bounds.size.width*2;
  int y = self.gameView.bounds.size.height;
  drop.center = CGPointMake(x, -y);
  </code></pre>
  
  <p>I started out with this code. Lines 2 and 3 are fine, I'm presenting them for clarity later.</p>
  
  <pre><code>let x = CGFloat(arc4random_uniform(UInt32(self.gameView.bounds.size.width * 5))) - self.gameView.bounds.size.width * 2
  let y = self.gameView.bounds.size.height
  dropView.center = CGPointMake(x, -y)
  </code></pre>
  
  <p>In Xcode 6 beta 3, it was necessary to cast the arc4random_uniform UInt32 result to CGFloat in order for the minus and multiplication to work. This doesn't work anymore and the compiler shows an error:</p>
  
  <p>‘CGFloat’ is not convertible to ‘UInt8’</p>
  
  <p>The release notes state:</p>
  
  <p>"CGFloat is now a distinct floating-point type that wraps either a Float on 32-bit architectures or a Double on 64-bit architectures. It provide all of the same comparison and arithmetic operations of Float and Double and may be created using numeric literals. Using CGFloat insulates your code from situations where your code would be
  !fine for 32-bit but fail when building for 64-bit or vice versa. (17224725)"</p>
  
  <p>Am I just doing something wrong with types? I don't even know how to describe this problem better to submit a bug report to Apple for beta 4. Pretty much every single Swift project I have that does any kind of point or rect manipulation got hit by this issue, so I'm looking for some sanity.</p>