Swift uses String.Index to navigate through character positions in String. For my understanding, it's done for performance, because of the usage of Extended Grapheme Clusters. Am I correct?
I was thinking, isn't there a better way to do it? We can still find a character by numeric index with
myString[myString.index(myString.startIndex, offsetBy: 7)]. I'm new to Swift, so please forgive my question, which may be naive. But I don't quite get it why Swift, a language with such a smart compiler, can't deal with efficient String offsetting and asks developers to work on it at low-level. I mean, it's such a basic thing we do on daily basis. Current implementation just doesn't match the philosophy of Swift and feels like some C++ feature.
Why is it such a complex problem?