mercredi 24 février 2016

Swift: Is there a more succinct way to write the "if let" block below?

   if let phone = participant.phone {
                participantObject["phone"] = phone
            } else { print("Did not add phone") }

I need to unwrap an "String?" and only make the assignment if the optional is not nil

Aucun commentaire:

Enregistrer un commentaire