Si la declaración Swiftui
var myBool: Bool = true
if myBool == true {
// myBool is true here
}
else {
// myBool is false here
}
Beautiful Bug
var myBool: Bool = true
if myBool == true {
// myBool is true here
}
else {
// myBool is false here
}
if (condition) {
// body of if statement
}
var someValue:Int?
var someAnotherValue:Int! = 0
if someValue != nil {
print("It has some value \(someValue!)")
} else {
print("doesn't contain value")
}
if someAnotherValue != nil {
print("It has some value \(someAnotherValue!)")
} else {
print("doesn't contain value")
}