Im getting this error: “ braced block of statements is an unused closure, expected expression and expression resolves to an unused function"

Im getting this error: “ braced block of statements is an unused closure, expected expression and expression resolves to an unused function"

这是我第一次做一个有点简单的项目,但出现了这些错误。 在过去的 2-3 小时里,我一直在努力完成这项工作。

任何帮助将不胜感激。

图片:https://i.stack.imgur.com/9YHbT.png

你打错了,试试这个:

if let uid = KeychainWrapper.standard.string(forKey: "uid") {

}

您需要将 if let 分配给 variable name 或使用 _