swift - "Charts"(IOS) xcode 9.0 编译错误 : "static var ' defaultFormatter ' is not public"

标签 swift xcode ios-charts

"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

enter image description here

enter image description here

enter image description here

最佳答案

至少,我只是让这个编译。如果你看这里: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/

相关文章:

iOS Charts Swift 条形图超出视野

ios - 在 xcode 8.2.1 的 obj-c 项目中使用 (ios-charts) 框架导致苹果 mach-o 链接器错误

swift - 不同 UIViewController 中变量的奇怪行为

python - 浏览器未读取我的网址

ios - 如何从方法中获取挂起的 View Controller ?

iphone - iPad 应用强制旋转

双击后 Ios 图表缩小

ios - 如何使具有多个 UITableViewCell 的 tableView(cellForRowAtIndexPath) 可读?

ios - 体系结构 x86_64 iOS swift 的 undefined symbol

xcode - 无法找到 `React-Core` 依赖的规范 `UMReactNativeAdapter`