Usually this works fine for me, but for some reason I am getting the error "Cannot assign a value of type 'CGFloat' to a value of type 'Int'" right now. I am simply trying to take my randomly generated integer and turn it into a CGFloat. However, it appears the code UInt32(self.view!.frame.width - dotRadius * 2)
is generating an error. Here is the code:
x = CGFloat(arc4random_uniform(UInt32(self.view!.frame.width - dotRadius * 2))) + dotRadius
Here is where I declare the dotRadius variable:
var dotRadius: CGFloat = 0
Anyone know why I'm not allowed to convert that? Any help is appreciated. Thanks!