Created
September 25, 2015 23:10
-
-
Save pedrogk/700ca903ea996623004f to your computer and use it in GitHub Desktop.
PersonalInformation
This file contains 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
struct PersonalInformation { | |
var name: String | |
var address: String | |
var dateOfBirth: NSDate | |
var age: Int { | |
get { | |
var today = NSDate() | |
var aTimeInterval = | |
today.timeIntervalSinceDate(dateOfBirth) | |
if aTimeInterval >= 0 { | |
return Int(aTimeInterval / 3.1536e7) | |
} else { | |
return 0 | |
} | |
} | |
} | |
var gender: Gender | |
var SSN: String | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment