I tried to do this (on the playground):
class SomeClass {
private let input: String.CharacterView
private var position: String.CharacterView.Index
...
private func advance() {
position += 1
}
}
... but I get the following error message:
error: binary operator '+ =' cannot be applied to operands of type 'String.CharacterView.Index' and 'Int'
The reason I am trying to increase this index is because I would like to do something like:
input[position]
... and access a specific character using input .
At this point, I already know that I cannot use this binary operator on a position . What would be a viable solution?
I am using Swift 3 and Xcode Version 8.0 beta 6 (8S201h)
source
share