Xcode升级到14 运行项目Chart报错处理

ChartDataSet文件报错,报错信息:

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

Unavailable instance method 'replaceSubrange(_:with:)' was used to satisfy a requirement of protocol 'RangeReplaceableCollection'

解决方案:

// MARK: RangeReplaceableCollection

extension ChartDataSet: RangeReplaceableCollection方法里补充

public func replaceSubrange(_subrange: Swift.Range, with  newElements: C) where C: Collection, ChartDataEntry == C.Element{

}

你可能感兴趣的:(Xcode升级到14 运行项目Chart报错处理)