I am calling getLineDash
of a UIBeizerPath
with this:
path.getLineDash(pattern.map{CGFloat($0)}, ...)
Where pattern
is a [Float]
(And I must use [Float]
, not [CGFloat]
) following Fast method to cast [Float] to [CGFloat]? to cast it to [CGFloat]
, but it is giving me
Cannot convert value of type '[CGFloat]' to expected argument type 'UnsafeMutablePointer<CGFloat>?'
Weirdly, performing
path.setLineDash(pattern.map{CGFloat($0)}, ...
Does not raise a compile error.
Following this question, I added as UnsafeMutablePointer<CGFloat>
but it is still giving me the error.