samedi 2 avril 2016

How to use guard in swift instead of if

How to use 'guard' in swift.I have gone through many articles about 'guard'.But i didnt get clear idea about this.Please give me clear idea.Please give me sample output for following 'if' statement.

if firstName != "" 
{
   if lastName != "" 
   {
      if address != "" 
      {
        // do great code
      }
   }
 }

Aucun commentaire:

Enregistrer un commentaire