我坚持使用这条简单的行,但无法将其从 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)
}