How can I convert a string into an array of single strings? So String -> [String]
If I do Array(myString)
it results in an array of characters. I tried flatmap (or compactMap in the latest Xcode beta):
stringArray = Array(myString).flatMap { $0 as? String }
Then I get a warning: "Cast from 'Character' to unrelated type 'String' always fails" and `print(stringArray) results in [].
Is this possible?
Edit: this was already answered in a non-accepted answer in this question: Convert Swift string to array