0
私はSwift 4に更新されていないMapBoxナビゲーションフレームワークを使用しています。ここにコードがあります。私は本当に助けに感謝します。ありがとうございました。Swift 4: 'subscript'が利用できないエラー
private func extractNextChunk(_ encodedString: inout String.UnicodeScalarView) throws -> String {
var currentIndex = encodedString.startIndex
while currentIndex != encodedString.endIndex {
let currentCharacterValue = Int32(encodedString[currentIndex].value)
if isSeparator(currentCharacterValue) {
let extractedScalars = encodedString[encodedString.startIndex...currentIndex]
encodedString = encodedString[encodedString.index(after: currentIndex)..<encodedString.endIndex]
return String(extractedScalars)
}
currentIndex = encodedString.index(after: currentIndex)
}
throw PolylineError.chunkExtractingError
}
ありがとうございます。私はそのテストを与えるでしょう。上に貼り付けた実際のコードに追加してください。それは私があなたの答えを100%確信しているわけではないので、大きな助けになるでしょう。 –
@ChelsMcKay:コンパイラエラーの原因となった 'encodedString = ...'行を置き換えるだけです。 –