Last active
January 18, 2018 13:34
-
-
Save agoiabel/89651488d788109015ed9781a927824f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
//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