0

I've made a fork of a library providing local country data for different counties.

I want to add there all countries and regions listed in ISO 3166, but there is an issue.

This standard (as wiki article) contains some country or region names using their local characters, like "Réunion" or "Åland Islands".

What would be correct swift names?

case reunion  
case alandIslands 

or

case réunion
case ålandIslands

Thank you.

Alexey_BH
  • 101
  • 7
  • Does `ålandIslands` not work as a Swift identifier? IIRC Swift does support those. – Sweeper Jun 19 '23 at 06:55
  • I would check how autocompletion works in Xcode for localized names since it might be hard for some to type local characters on their keyboard – Joakim Danielson Jun 19 '23 at 07:11
  • ålandIslands works okay, but the question is related to using these unicode names... I guess that typing it wouldn't be so easy task. – Alexey_BH Jun 19 '23 at 09:40
  • So does it worth keep original characters to keep names as they appear or replace them with most similar English alphabet characters to make them easy accessible as possible. – Alexey_BH Jun 19 '23 at 09:42
  • 1
    How about: `case alandIslands = "Åland Islands"` using a raw type String? Optionally, you may further add an extension defining a static which acts as an alias to a certain enum case. So, basically providing two cases for the same raw string. – CouchDeveloper Jun 19 '23 at 09:53

0 Answers0