This comparison worked in Swift 2 but doesn't anymore in Swift 3:
let myStringContainsOnlyOneCharacter = mySting.rangeOfComposedCharacterSequence(at: myString.startIndex) == mySting.characters.indices
In Swift 2,
Range<Index>, but because a range is a simple pair of indices and indices can no longer be advanced on their own,
Range<Index>is no longer iterable.
In order to keep code like the above working,
Collectionhas acquired an associated Indices type that is always iterable, ...
rangeOfComposedCharacterSequence returns a range of
character indices, the solution is not to use
myString.rangeOfComposedCharacterSequence(at: myString.startIndex) == myString.startIndex..<myString.endIndex