如何将旧 CocoaPod 框架的 Swift 版本更改为版本 5

时间:2021-01-29 14:16:27

标签: ios swift xcode cocoapods

我正在将旧的 cocopod 框架的代码更新为 Swift 5。最初如果使用该框架的代码,我会收到如下错误:

行:UIResponder.keyboardWillShowNotification

错误:

<块引用>

'keyboardWillShowNotification' 已重命名为 'NSNotification.Name.UIKeyboardWillShow'

<块引用>

将“keyboardWillShowNotification”替换为“NSNotification.Name.UIKeyboardWillShow”

所以我克隆了原始 pod 的 repo 并更新了它的代码。但是现在我在 pod 项目中得到了相反的错误:

更新行:NSNotification.Name.UIKeyboardWillShow(现在是正确的方式)

<块引用>

'UIKeyboardWillShow' 已重命名为 'UIResponder.keyboardWillShowNotification'

<块引用>

将“UIKeyboardWillShow”替换为“UIResponder.keyboardWillShowNotification”

我尝试转到 Target > Build Settings 并将 Swift 版本更改为 5,如here 所述。但这无济于事。我还应该改变什么?我想使用针对 Swift 5 更正的代码创建拉取请求。

swift compiler version settings

0 个答案:

没有答案