Swift 2.0 : 'enumerate' is unavailable: call the 'enumerate()' method on the sequence

前端 未结 3 1895
小鲜肉
小鲜肉 2020-11-30 05:31

Just downloaded Xcode 7 Beta, and this error appeared on enumerate keyword.

for (index, string) in enumerate(mySwiftStringArray)
{

}

3条回答
  •  迷失自我
    2020-11-30 06:18

    There was an update for Swift 2 on using enumerate().

    Instead of enumerate(...), people should use

    ... .enumerate()

    The reason is that many global functions have been replaced by protocol extension methods and they will get an enumerate error.

    Hope this helps. All the best. n

提交回复
热议问题