I read that in order to pass a swift variable/constant to an argument that expects UnsafePointer can be done by using the 'inout' (ampersand) symbol prefixing the variable/constant. So in the following code, I want to pass the 'colors' array as "UnsafePointer' to the function CGGradientCreateWithColorComponents(), but I get a compiler error:
"& used with non-inout argument of type UnsafePointer"
See image below for visual.
So, the question is , how can I convert the swift array 'colors' into an UnsafePointer ?
thanks