Swift:'==' 不是前缀一元运算符

Rad*_*033 -3 swift

我正在构建一个简单的 swift 3 应用程序,因为我现在正在学习它,但我收到了这个错误 '==' is not a prefix unary operator

这是我的代码

@IBAction func convertClicked(_ sender: Any) {
    if let result = tempEntry.text {
        if(result =="") {
            return
        } else {
            if let num = Double(result) {
                let output = num * (9/5) + 32
                ResultLabel.text = String(output)
            }
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

Mik*_*ash 5

尝试在“==”后添加空格。

代替 :

if(result =="") {
Run Code Online (Sandbox Code Playgroud)

尝试:

if(result == "") {
Run Code Online (Sandbox Code Playgroud)