This is driving me nuts.
In Swift 2.2, it makes it impossible to subscript String
with Int
. For example:
let myString = "Test string"
let index = 0
let firstCharacter = myString[index]
This will result with a compile error, saying
'subscript' is unavailable: cannot subscript String with an Int, see the documentation comment for discussion
One workaround I see is to convert integer to the index type, but I can't figure out how..