"Charts"(IOS-danielgindi)
在 Xcode 8 上一切正常。
但是,编译为 pod version '3.0.3'
后出现错误
pod 版本 '3.0.4'
发布后,我更新了 pod,仍然显示以下错误。
它们是同一类型的错误 -
static var 'defaultFormatter' is not public
并显示
Static var 'defaultFormatter' is internal and cannot be referenced from a default argument value
在图表文件中。 有时显示 6 个错误,有时显示 8 个错误。
我是 swift 的新手,不知道如何解决这个问题。 任何帮助或建议将不胜感激。 谢谢!
错误显示以下 .swift 文件:
ChartAxisLabelGeneratorDate
ChartAxisLabelsGeneratorNumber
ChartAxisLabelsGeneratorNumberSuffix
ChartAxisValueDouble
ChartAxisValueDoubleScreenLoc
ChartAxisValueFloat
ChartAxisValueFloatScreenLoc
最佳答案
至少,我只是让这个编译。如果你看这里:https://github.com/i-schuetz/SwiftCharts/commit/46a8fd70c10b38c2a3fa5862418f106ee218c388
看起来有一个解决这个问题的提交。我不确定为什么它没有通过 Cocoapods 下降,但我是这方面的新手,所以我可能只是做错了什么。我最终所做的只是将“public”放在每个默认格式化程序声明的前面。所以这个:
static var defaultFormatter: DateFormatter = {
改为:
public static var defaultFormatter: DateFormatter = {
看看这是否适合您。
关于swift - "Charts"(IOS) xcode 9.0 编译错误 : "static var ' defaultFormatter ' is not public",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46541229/