Just downloaded Xcode 7 Beta, and this error appeared on enumerate
keyword.
for (index, string) in enumerate(mySwiftStringArray)
{
}
Can anyone help me overcome this ?
Also, seems like count()
is no longer working for counting length of String
.
let stringLength = count(myString)
On above line, compiler says :
'count' is unavailable: access the 'count' property on the collection.
Has Apple has released any programming guide for Swift 2.0 ?
Many global functions have been replaced by protocol extension methods, a new feature of Swift 2, so
enumerate()
is now an extension method forSequenceType
:and used as
And
String
does no longer conform toSequenceType
, you have to use thecharacters
property to get the collection of Unicode characters. Also,count()
is a protocol extension method ofCollectionType
instead of a global function:Update for Swift 3:
enumerate()
has been renamed toenumerated()
: