multiple optional binding for a immutable variable and an immutable

35 Views Asked by At

I want to have a multiple optional binding for a mutable and an immutable optional strings. but this code has an error

var name: String?
let family: String?
if var temp1 = name, temp2 = family{
    print("ok")
}

error: constant family used before being initializes

0

There are 0 best solutions below