Calling toJSONString after creating an object with the UIColor.clear property reports an error and fails to serialize successfully.
Code
class SandBoxModel: HandyJSON {
var mode: Int = 0
var color: UIColor = .clear
func mapping(mapper: HelpingMapper) {
mapper <<<
color <-- HexColorTransform()
}
public required init() {}
}
var model = SandBoxModel()
model.color = .clear
if let jsonString = model.toJSONString {
print(jsonString)
}
Error
Swift/ContiguousArrayBuffer.swift:580: Fatal error: Index out of range
Question
Calling toJSONString after creating an object with the UIColor.clear property reports an error and fails to serialize successfully.
Code
Error
Swift/ContiguousArrayBuffer.swift:580: Fatal error: Index out of range