Charts: Failed to build Project in Xcode 14.0.1 with error of protocol 'RangeReplaceableCollection'

What did you do?

installed pod ‘Charts’ and it’s not building, showing an error Type 'ChartDataSet' does not conform to protocol 'RangeReplaceableCollection'

ℹ Please replace this with what you did.
just install the latest version of the library (pod) and build the project

What did you expect to happen?

should successfully build the project.

ℹ Please replace this with what you expected to happen.
build project successfully.

What happened instead?

showing error Type 'ChartDataSet' does not conform to protocol 'RangeReplaceableCollection'

Charts Environment

Charts version/Branch/Commit Number: 3.6 Xcode version: 14.0.1 Swift version: iOS 16 Platform(s) running Charts: - macOS version running Xcode: macOS Monterey v12.6

Screenshot 2022-10-20 at 9 54 54 PM Screenshot 2022-10-20 at 9 55 18 PM

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 2
  • Comments: 18

Most upvoted comments

image

public func replaceSubrange<C>(_ subrange: Swift.Range<Int>, with newElements: C) where C : Collection, ChartDataEntry == C.Element { }

As an alternative, updating to the latest release: 4.1.0, should also fix the issue. It did for me (with a couple of additional changes like replacing IAxisValueFormatter with AxisValueFormatter for example).