XCode14 Charts报错:Type 'ChartDataSet' does not conform to protocol 'RangeReplaceableCollection'

XCode14 报错:
Unavailable instance method 'replaceSubrange(_:with:)' was used to satisfy a requirement of protocol 'RangeReplaceableCollection'
Type 'ChartDataSet' does not conform to protocol 'RangeReplaceableCollection'

解决方案:
// MARK: RangeReplaceableCollection
extension ChartDataSet: RangeReplaceableCollection 方法里补充

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

你可能感兴趣的:(XCode14 Charts报错:Type 'ChartDataSet' does not conform to protocol 'RangeReplaceableCollection')