Charts
Charts copied to clipboard
Fixes for Swift 5.7 compiler
Issue Link :link:
I'm currently experimenting with the latest development Swift 5.7 toolchain and the Charts library was not compiling due to a bug in the implementation of RangeReplaceableCollection
on ChartDataItem
.
This PR fixes that by adding the missing protocol method and also fixes a couple of compiler warnings (which I think also exist on the latest stable toolchain).
More info on this here: https://github.com/apple/swift/issues/58737 - the reason this compiled pre-5.7 was due to a bug in Swift which was due to be fixed in 5.6, reverted and will ship in 5.7 by the looks of it.
Goals :soccer:
Library can now be compiled with Swift 5.7.
Testing Details :mag:
Library continues to compile under 5.6.
I wasn't able to get the snapshots to pass on my M1 Max laptop - maybe I'm using the wrong simulator. The failures were very subtle and I don't think are related to this change.
I also face other compiler errors:
-
EaseOutBack
in ChartAnimationEasing.swift This fix worked for me https://github.com/danielgindi/Charts/pull/4836
internal static let EaseOutBack = { (elapsed: TimeInterval, duration: TimeInterval) -> Double in
let s: TimeInterval = 1.70158
var position: TimeInterval = elapsed / duration
position -= 1.0
return Double( position * position * ((s + Double(1.0)) * position + s) + Double(1.0) )
}
-
func drawDataSet
in RadarChartRenderer.swift
for case let set as RadarChartDataSetProtocol in (radarData as ChartData) where set.isVisible
{
drawDataSet(context: context, dataSet: set, mostEntries: mostEntries)
}
for case let set as CandleChartDataSetProtocol in (candleData as ChartData) where set.isVisible
{
drawDataSet(context: context, dataSet: set)
}
from: https://github.com/danielgindi/Charts/issues/4860#issuecomment-1178968435
Any update when this could be reviewed and merged?
Any update when this could be reviewed and merged?
my comments above haven't resolved yet, not sure yet. I tried this PR with beta 3, however couldn't build & run.
Probably the latest time is when Xcode GM released and I can try it without bothering from beta releases.
Thanks for contributing!
@pmairoldi do you have a deadline for a new version?
Waiting for Xcode 14 gm before releasing anything.
@pmairoldi The GM is here, let me know if I can help you with anything.
Waiting for Xcode 14 gm before releasing anything.
thanks pal! been busy with the new job, as we also had tons of issues regarding Xcode 14 RC and iOS 16