I'm having a brain cramp this afternoon. This should be easy.
I did read the docs.
It's easy to convert single instances of Float <> CGFloat but I'm looking for a fast method to cast a LARGE array > 500,000 elements of [Float] to [CGFloat].
var sphereRadiusFloat:[Float] = [0.0,1.0,2.0]
var sphereRadiusCGFloat:[CGFloat] = []
sphereRadiusCGFloat = sphereRadiusFloat as CGFloat
The error is
CGFloat is not convertible to [CGFloat]
I also tried
sphereRadiusCGFloat = CGFloat(sphereRadiusFloat)
which gives error
Could not find an overload operator for 'init' that accepts supplied arguments.
Anyobject
route and like the map solution from @Leonardo Savio Dabus as it isperl-ish
. I'm a fan of those powerful one-liners. – μολὼν.λαβέmap
is looping, you just don't see the loop explicitly. It may be no faster. – vacawama