Swift: 无法将类型 [CombinedChartView.DrawOrder] 的值分配给 [int] 的值
Swift: Cannot assign a value of type [CombinedChartView.DrawOrder] to a value of [int]
我正在使用 https://github.com/danielgindi/ios-charts/
我有实现委托:ChartViewDelegate
代码:
chartView.drawOrder = [CombinedChartView.DrawOrder.Bar, CombinedChartView.DrawOrder.Line]
但是我有这个错误:
Cannot assign a value of type [CombinedChartView.DrawOrder] to a value of [int]
我可以在 Obj-C 中使用 drawOrder,但不能在 Swift 中使用相同的代码。有办法解决吗?
尝试:
chartView.drawOrder =
[
CombinedChartView.DrawOrder.Bar.rawValue,
CombinedChartView.DrawOrder.Line.rawValue
]
我正在使用 https://github.com/danielgindi/ios-charts/ 我有实现委托:ChartViewDelegate
代码:
chartView.drawOrder = [CombinedChartView.DrawOrder.Bar, CombinedChartView.DrawOrder.Line]
但是我有这个错误:
Cannot assign a value of type [CombinedChartView.DrawOrder] to a value of [int]
我可以在 Obj-C 中使用 drawOrder,但不能在 Swift 中使用相同的代码。有办法解决吗?
尝试:
chartView.drawOrder =
[
CombinedChartView.DrawOrder.Bar.rawValue,
CombinedChartView.DrawOrder.Line.rawValue
]