Question: what is difference between if and guard in swift?
Answer: guard let will unwrap an optional for you, but if it finds nil inside it expects you to exit the function, loop, or condition you used it in. However, the major difference between if let and guard let is that your unwrapped optional remains usable after the guard code.