Skip to content

Instantly share code, notes, and snippets.

@agoiabel
Last active April 16, 2020 20:13
Show Gist options
  • Save agoiabel/bdd898d752f28dfaee38771c3c981f9a to your computer and use it in GitHub Desktop.
Save agoiabel/bdd898d752f28dfaee38771c3c981f9a to your computer and use it in GitHub Desktop.
Person {
var firstname: String
var middlename: String
var lastname: String
}
//this will definitely work because i have a middlename
let me = Person(firstname: "Abel", middlename: "abel", lastname: "Adeyemi")
//This will throw an error
let anotherPerson = Person(firstname: "Abel", middlename: nil, lastname: "Adeyemi")
@SrivalliChaturvedula
Copy link

It shows me error if I use the class . Send me code using class keyword.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment