Created
August 14, 2019 12:37
-
-
Save laevandus/ab4bd0ae1a8006cf76ccff8eb2db2fa7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Contact { | |
var fullName: String | |
@EmailValidated var email: String? | |
} | |
var contact = Contact(fullName: "Toomas") | |
contact.email = "invalidemail" | |
print(contact.email as Any) // nil | |
contact.email = " test toomas@email.zz" | |
print(contact.email as Any) // nil | |
contact.email = "toomas@email.zz" | |
print(contact.email as Any) // Optional("toomas@email.zz") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment