在范围内找不到类型“IAxisValueFormatter”

M.A*_*edo 7 charts ios swift

我正在尝试使用库https://github.com/danielgindi/Charts但最近它在这部分给我带来了问题:

final class CustomDateFormatter: NSObject, IAxisValueFormatter {

private let dateFormatter = DateFormatter()

override init() {
super.init()
dateFormatter.dateFormat = "MMM-yy"
}

func stringForValue(_ value: Double, axis: AxisBase?) -> String {
let newDate = Calendar.current.date(byAdding: .month, value: Int(value), to: Date())
return dateFormatter.string(from: newDate ?? Date()).lowercased()
}

}
Run Code Online (Sandbox Code Playgroud)

错误是:

Cannot find type 'IAxisValueFormatter' in scope
Run Code Online (Sandbox Code Playgroud)

And*_*rcu 18

貌似IAxisValueFormatter改名了AxisValueFormatter。更多信息请参见https://github.com/danielgindi/Charts/issues/4775