PART 1
currentYear
that is an integer equal to the current year (e.g. 2016).String
, last name as a String
, and year of birth as an Int
.Person
structPART 2
age
to the Person
structage
. The getter should calculate and return the person's age based on the current year and the person's year of birth. (Hint: Look up getters in the Swift programming guide or in documentation).age
. The setter should update the year of birth based on the age and current year. (Hint: look up setters).Change your currentYear
constant so that instead of being a hard-coded, static year, it uses NSDateComponents
to get the actual current year anytime it runs. Documentation should help you out.