0
我堅持這個簡單的線條,但不能從斯威夫特2轉換爲雨燕3.C風格的聲明,斯威夫特3
for(index = indexes.lastIndex;
index != NSNotFound;
index = indexes.indexLessThanIndex(index))
{
}
我堅持這個簡單的線條,但不能從斯威夫特2轉換爲雨燕3.C風格的聲明,斯威夫特3
for(index = indexes.lastIndex;
index != NSNotFound;
index = indexes.indexLessThanIndex(index))
{
}
這可能與while
環
var index = indexes.lastIndex
while index != NSNotFound {
// do something with index
index = indexes.indexLessThanIndex(index)
}
被替換
你從哪種語言轉換而來?原始代碼是用Swift 2,C語言還是其他語言編寫的? –
從swift 2開始,謝謝 –
https://github.com/apple/swift-evolution/blob/master/proposals/0007-remove-c-style-for-loops.md –