-4

I'm building a simple swift 3 application as I am learning it now, and I got this error '==' is not a prefix unary operator

This is my code

@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)
            }
        }
    }
}
loliki
  • 947
  • 2
  • 16
  • 38

1 Answers1

4

Try to add space after '=='.

Instead of :

if(result =="") {

try:

if(result == "") {
Miknash
  • 7,888
  • 3
  • 34
  • 46