Get an error when trying to use multiplication
var red1 : Float = ((random()%9)*30)/255;
Error says Int
is not convertible to Float
I want to use this to make a float I can use to make a UIColor
Get an error when trying to use multiplication
var red1 : Float = ((random()%9)*30)/255;
Error says Int
is not convertible to Float
I want to use this to make a float I can use to make a UIColor
var red1 = Float((random()%9)*30)/255
You don't need the semicolon and red1 will be type inferred to a Float.
In swift 4.2: var red1 = Float.random(in: startNumber...endNumber)