Skip to content

Instantly share code, notes, and snippets.

@agoiabel
Last active January 18, 2018 13:34
Show Gist options
  • Save agoiabel/89651488d788109015ed9781a927824f to your computer and use it in GitHub Desktop.
Save agoiabel/89651488d788109015ed9781a927824f to your computer and use it in GitHub Desktop.
//First Implementation
struct Lecturer: FullNameable {
var fullName: String
}
let lecturer = Lecturer(fullName: "Gift")
//Second Implementation
struct Student: FullNameable {
let firstName: String
let middleName: String
let lastName: String
var fullName: String {
return "\(firstName) \(middleName) \(lastName)"
}
}
let me = Student(firstName: "Abel", firstName: "Agoi", lastName: "Adeyemi")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment