swift - UIKit.NSUnderlineStyle single 或 styleSingle

标签 swift cocoapods

我正在尝试升级我的 AttributedTextView库到 Swift 4.2。 在此转换期间,我必须将 NSUnderlineStyle.styleSingle 更改为 NSUnderlineStyle.single,现在我的项目已构建并运行

现在我想发布我的更新,但是在执行 pod lib lint 时出现以下错误:

- ERROR | [iOS] xcodebuild:  /Users/evermeer/Dev/GitHub/AttributedTextView/Sources/Attributer.swift:621:48: error: 'single' has been renamed to 'styleSingle'
- NOTE  | [iOS] xcodebuild:  UIKit.NSUnderlineStyle:15:23: note: 'single' was introduced in Swift 4.2

当我将其改回 styleSingle 时,pod 错误消失,但我的项目无法构建。

我的 Pod 规范确实包含该行

 s.pod_target_xcconfig = { 'SWIFT_VERSION' => '4.2' }

但将其设置为任何其他版本都没有帮助。

知道如何解决这个问题吗?

最佳答案

您应该使用:s.swift_version = '4.2'

,而不是使用现已弃用的 pod_target_xcconfig

就我而言,我还有一个名为 .swift_version 的文件,其中包含 4.0

如果您同时使用两者并且它们不同,那么您将收到警告。

关于swift - UIKit.NSUnderlineStyle single 或 styleSingle,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52436882/

相关文章:

swift - Swift 类型错误 :Cannot convert value of type '[UInt64]' to expected argument type 'inout UInt64'

iOS:如何将多天数据添加到 Health Kit Store

swift - 当尝试从 iOS9 的数据库中获取超过 512 个项目时,该方法会挂起。但它适用于 iOS10 及更高版本

ios - 将 pod 部署到 artifactory 的理想方式是什么?

ios - 我怎样才能让真正的苹果 watch 打开父应用程序

swift - 如何使用日期或日历更改UITextView中的值?

ios - UITableView滚动执行动画CPU使用率高

ios - CocoaPods 项目依赖于本地静态 C 库

iOS CocoaPod 警告 - "Google has been deprecated"- 使用 pod 'Google/SignIn' 时

ios - Pod 未在 Pods 文件中列出,但它安装在 pod install 命令上