新しくアップデートされたXcode7で以下のコードを実行してみた
let colorList = ["bulew","yellow","red","green"]
for (index,value) in enumerate(colorList) {
print((index,value))
}
ここで、エラーが出る。
'enumerate' is unavailable: call the 'enumerate()' method on the sequence
そこで、以下のようにしたらエラーが治って正常に実行できるようになった。英語では情報が出回っているのだが、日本語ではないので書いておいた
let colorList = ["bulew","yellow","red","green"]
for (index,value) in colorList.enumerate() {
print((index,value))
}
ちょっとしたtipだが、役に立てていただければ幸いである。