-
-
Save ashokkumarmw/519f6f033fb13d40909b28d66d7e5e81 to your computer and use it in GitHub Desktop.
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
func getDateOfBirth() -> (dicHealth: [String: Any]?, dob: UInt64?) { | |
do { | |
let dateOfBirth = try self.healthKitStore.dateOfBirth() | |
var dicHealth = [String: Any]() | |
dicHealth["DateOfBirth"] = dateOfBirth.epoch() // it gets epoch number from the date and there is no issue inside. | |
dicHealth["TimeZone"] = getTimeZoneString() | |
return (dicHealth, dateOfBirth.epoch()) | |
} catch _ { | |
print("Either an error occured fetching the user's age information or none has been stored yet.") | |
return (nil, nil) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment