Swift2 Swift 3语句的C样式

Swift2 Swift 3语句的C样式,swift2,swift3,Swift2,Swift3,我被这条简单的线卡住了,但无法将它从Swift 2转换为Swift 3 for(index = indexes.lastIndex; index != NSNotFound; index = indexes.indexLessThanIndex(index)) { } 这可以替换为while循环 var index = indexes.lastIndex while index != NSNotFound { // do something with index in

我被这条简单的线卡住了,但无法将它从Swift 2转换为Swift 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,谢谢