Charts
Charts copied to clipboard
Support for Xcode 14
What did you do?
Build the project with Xcode 14 Beta 3
What did you expect to happen?
For the project to successfully build.
What happened instead?
There are 2 types of build errors
- Build error around
CandleStickChartRenderer
's andRadarChartRenderer
'sdrawData(context: CGContext)
where theIndexingIterator
are not equivalent. Raw message:
error build: Referencing instance method 'makeIterator()' on 'Collection' requires the types 'IndexingIterator<ChartData>' and 'IndexingIterator<RadarChartData>' be equivalent
- Build error around
ChartDataSet
not conforming toRangeReplaceableCollection
asreplaceSubrange(_:with:)
is missing. Raw messages:
error build: Type 'ChartDataSet' does not conform to protocol 'RangeReplaceableCollection'
error build: Unavailable instance method 'replaceSubrange(_:with:)' was used to satisfy a requirement of protocol 'RangeReplaceableCollection'
Charts Environment
Charts version/Branch/Commit Number: 4.0.3 Xcode version: Xcode 14 Beta 3 (14A5270f) Swift version: 5.7 Platform(s) running Charts: iOS macOS version running Xcode: 12.4 (21F79)
Saw the same error this morning after upgraded to beta3. Beta 2 is fine, I guess for now I'll stick to beta 2 until this got resolved
I resorted to just unlocking the files and resolving locally. Lasts until the pod gets reinstalled. For each:
- Commenting out the whole
for case let...
block - Added this function to the bottom of the extension.
public func replaceSubrange<C>(_ subrange: Swift.Range<Index>, with newElements: C) where C : Collection, Element == C.Element {
fatalError()
}
I know these aren't solutions, just unblocks me for now.
@gsbernstein https://github.com/danielgindi/Charts/blob/c3701a4e5ce111c29dd7af9e19e6a346ccf0ad52/Source/Charts/Data/Implementations/Standard/ChartDataSet.swift#L427-L431 from https://github.com/danielgindi/Charts/pull/4823
will look into this. Is there any PR available already? Normally I would prefer beta 6 to start the fix
Xcode 14 beta 3 fixed the issue with EaseOutBack
closure not resolving types in time.
So the only issues are the replaceSubrange
which I linked to a potential fix above and I haven’t found a workaround for:
Build error around CandleStickChartRenderer's and RadarChartRenderer's drawData(context: CGContext) where the IndexingIterator are not equivalent.
Xcode 14 beta 3 fixed the issue with
EaseOutBack
closure not resolving types in time.So the only issues are the
replaceSubrange
which I linked to a potential fix above and I haven’t found a workaround for:Build error around CandleStickChartRenderer's and RadarChartRenderer's drawData(context: CGContext) where the IndexingIterator are not equivalent.
#4823 is definitely something I would merge fast, but have to think about older swift versions, if nothing special, will get it merged. I have to squeeze my drive to make some pace for beta first...
Xcode 14 beta 3 fixed the issue with
EaseOutBack
closure not resolving types in time.
Not on my side (and I do have those two new errors too).
for case let set as CandleChartDataSetProtocol in (candleData as ChartData) where set.isVisible
{
drawDataSet(context: context, dataSet: set)
}
Makes CandleStickChartRenderer
build.
Just ran into this in Xcode 14 Beta 3 as well...and can't go back as I can't submit updates in Beta 2, beta season always fun 🤦♂️
Xcode 14 beta 4 as well.
Xcode beta 5 doesn't fix it
Will there any chance that the fix will be applied and solved before the Xcode 14 public release?
Will there any chance that the fix will be applied and solved before the Xcode 14 public release?
If not it's good time to say "good bye" for this library.
Xcode beta 5 doesn't fix it
It won't ever be fixed by a new release of Xcode because it was a known bug in Swift for quite some time, and has only recently been fixed in Swift 5.7
You can check out the original bug here: https://github.com/apple/swift/pull/38950
Any updates on if this is going to be addressed soon? Xcode 14 is a month out.
If I'm not mistaken, there are some PRs waiting for approval, which are fixing the issue. Can we merge them?
It looks like said PRs have been merged. Any timeline on a new release?
@waterskier2007 Indeed and code just works fine.
If you do not want to wait until public release you can simply specify branch "master" and not the version.
I will release a new version when Xcode gm become available
With the RC now available, what are the chances on a new release?
@pmairoldi any updates?
I was off for the last couple days. I will look at it tonight.
closed by https://github.com/danielgindi/Charts/releases/tag/v4.1.0
closed by https://github.com/danielgindi/Charts/releases/tag/v4.1.0
It is installing the 3.6.0 with pod 'Charts'.
@DanieleCiti - try increasing the minimum deployment target to 14.0 in your podfile. that should resolve the issue.
@DanieleCiti - try increasing the minimum deployment target to 14.0 in your podfile. that should resolve the issue.
Done it and I only have one error now: No such module 'Algorithms'
@DanieleCiti - i ran into that as well. i just deleted the charts pod and went with swift package instead, which worked.
@DanieleCiti - i ran into that as well. i just deleted the charts pod and went with swift package instead, which worked.
I'm gonna do the same -> Adding a package with "Up to next major 4.1.0 < 4.0.0" from https://github.com/danielgindi/Charts.git. That's what you did too?
@DanieleCiti - yep!
@DanieleCiti - yep!
Thanks a lot for your time! It taking a bit of time on the "fetching https://github.com/danielgindi/Charts.git" screen. How long did it takes for you to finish?