では使用できません、私はXCodeの8ラインに'advancedByは' 現在のXcode 8
let range = key.startIndex...key.startIndex.advancedBy(0)
を使用してきた私はエラーを取得する:
error: 'advancedBy' is unavailable: To advance an index by n steps call 'index(_:offsetBy:)' on the CharacterView instance that produced the index.
が、私はこれをどのように修正することができますか?
エラーのスクリーンショットは以下の通りです:
あなたの質問のコードだけでなく、スクリーンショットを添付してください。 – Paulw11
インデックスoffsetByを使用する必要があります。http://stackoverflow.com/a/38215613/2303865 –
https://github.com/apple/swift-evolution/blob/master/proposals/0065-collections-move-indicesをご覧ください。 md – HAS