Min function doesn't work on values greater than 9,999. Any idea why?

That's intentional, or at least it was originally: you couldn't assume a stable order between different versions of the stdlib or even the same version across platforms. For example, in the pre-Swift-4.1 days, you actually had different ordering on Linux than Darwin. Since then, we've ordered based on scalar values in NFC on all platforms, but in theory that could be changed. E.g. scalar values in NFD order differently than in NFC.

Ordering of String needs to be fast and obey canonical equivalence for use in things like sorted data structures, but the particular order is arbitrary and meaningless. That's why it was changed from UCA (slow) to NFC (fast) scalar value order (which is equivalent to NFC UTF-8 code unit order) way back in Swift 4.

If ordering is presented to a user or for any kind of non-machine-consumption purpose, you should use a higher level framework. Linguistic ordering varies dramatically across languages and even across applications (e.g. German phonebook order is different than German dictionary order).

With @Alejandro 's exciting work on native normalizations, we might start exposing normalization-oriented API, including "give me the fast one". At that point we might formalize the ordering.

10 Likes