Currently, I've been using XCode 8 and on the line
let range = key.startIndex...key.startIndex.advancedBy(0)
I get the error:
error: 'advancedBy' is unavailable: To advance an index by n steps call 'index(_:offsetBy:)' on the CharacterView instance that produced the index.
How can I fix this?
A screenshot of the error is below:
advancedBy(_:)
has been deprecated in Swift v3 and replaced by index(_:offsetBy:)
. Refer to Apple's migration guide for more info.
The solution to your error:
let range = key.startIndex...key.index(key.startIndex, offsetBy: 0)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With