by TimTheTinker · 7y ago · 0 comments
Here's the full list: https://developer.apple.com/documentation/contacts/contacts_...
A second issue is, this is probably a localisation / cultural concern: below, yorwba notes that this relationship is a specific term in chinese kinship: https://en.wikipedia.org/wiki/Chinese_kinship#Common_extende....
https://stackoverflow.com/questions/6163683/cycles-in-family...
Of course, this is kind of co-opting the call stack to build up at runtime what the compiler can already provide as an AST, so it might be better to just use a macro.
This representation can't be serialized quite as easily as a single symbol or whatever Apple is doing, but it is infinitely flexible. And it seems like a code smell to me that they have a special case for the father's brother, while the mother only has a generic "sibling." It should be up to the view layer to determine that kind of localization-specific logic. If you just store a completely arbitrary relation then you can punt it to the localization to decide how to translate that into meatspeak.
enum CNLabelContactRelation {
static let aunt = "…"
static let auntFathersBrothersWife = "…"
}