Skip to content

Instantly share code, notes, and snippets.

@agoiabel
Last active January 13, 2018 08:35
Show Gist options
  • Save agoiabel/3ce78b3909a0ab67ef835df16e593d77 to your computer and use it in GitHub Desktop.
Save agoiabel/3ce78b3909a0ab67ef835df16e593d77 to your computer and use it in GitHub Desktop.
Person {
var firstname: String
var middlename: String? //we created the optional with the ?
var lastname: String
func fullName() -> () {
print("Your fullname is \(firstname) \(middlename!) \(lastname)")
}
}
let me = Person(firstname: "Abel", middlename: "Agoi", lastname: "Adeyemi")
me.fullName() //will return "Your fullname is Abel Agoi Adeyemi"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment