gpt4 book ai didi

ios - SwiftDate 5.0 编译问题

转载 作者:行者123 更新时间:2023-11-28 07:32:48 26 4
gpt4 key购买 nike

当我通过 Cocoapods 安装 SwiftDate 并尝试构建我的项目时,我从 SwiftDate 库中收到三个错误:

/Pods/SwiftDate/Sources/SwiftDate/DateInRegion/DateInRegion.swift:11:15: Type 'DateInRegion' does not conform to protocol 'Hashable'

/Pods/SwiftDate/Sources/SwiftDate/DateInRegion/DateInRegion+Create.swift:50:33: Type 'UInt32' has no member 'random'

/Pods/SwiftDate/Sources/SwiftDate/DateInRegion/DateInRegion+Create.swift:65:37: Type 'UInt32' has no member 'random'

我使用的 SwiftDate、Swift 或 XCode 版本不正确吗?当我尝试安装 SwiftDate 4.5.1 时,库中没有出现任何错误,但 SwiftDate 函数都没有实际工作。

最佳答案

由于 SwiftDate5.0.0+ 版本包含来自 Swift 4.2 的代码,您必须安装支持此版本 Swift (Xcode 10+) 的 Xcode。

否则,您可以使用最新版本的 SwiftDate,它不使用 Swift 4.2 中的代码,例如通过在 podfile 中指定 cocoapod 的版本轻松获取随机数 (SwiftDate 4.5.0)

pod 'SwiftDate', '4.5.0'

关于ios - SwiftDate 5.0 编译问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54183450/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com