if let unwrappedValue = optionalValue {
// Do something with the unwrappedValue
} else {
// Handle the case where optionalValue is nil
}
let optionalName: String? = "Alice"
if let name = optionalName {
print("Hello, \(name)!")
} else {
print("Hello, anonymous person!")
}
// the if let is the optional value part. If optionalName variable has a value then it will run. If the value is nil then the else statement will run.