if

Swift provides if to define conditional statements. It executes a set of statements only if the condition statement is true. For instance, in the following example, the print statement will be executed because anEmptyString is empty:

var anEmptyString = "" 
if anEmptyString.isEmpty {
print("An empty String")
} else {
// String is not empty.
}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset