O'Reilly logo

Swift Functional Programming - Second Edition by Dr. Fatih Nayebi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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. } 

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required