I have a question about 'if let' statement in the context of Optionals.
Basically, I thought that if statement works like this 'if (true) { (this statement will execute) } if (false) { (this statement will not execute) }
but in the 'if let' statement, it doesn't work like above.
Here is the code:
var isDeleted: Bool?
isDeleted = false
if let deleted = isDeleted { print(deleted) }
in above code, maybe you know that 'let deleted = isDeleted' returns 'false' but, 'print(deleted)' is successfully executed Does anyone know why?