[SR-1826] CGGradient initializer imported incorrectly into Swift 3 #44435
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
SDKOverlay
Environment
Xcode Version 8.0 beta (8S128d)
Additional Detail from JIRA
md5: c94429680602a936e55b543293f9f2b4
Issue Description:
In Swift 2.2, we had:
In Swift 3 this has changed to:
The documentation for the locations parameter states that locations may be either:
NULL
An array of CGFloats with the same number of elements as the colors array
This new Swift 3 initializer does not accept `nil` for locations, which it probably should. In which case taking a type of `UnsafePointer<CGFloat>?` would be better. However, wouldn't an `UnsafeBufferPointer<CGFloat>?` be preferred? Although ideally it would accept `[CGFloat]?` and avoid unsafe pointers altogether.
The text was updated successfully, but these errors were encountered: