Prior to the new Swift version I was using the following code in my app. Now it launches an exception.
for (i, in 0 ..< len){ let length = UInt32 (letters.length) let rand = arc4random_uniform(length) randomString.appendFormat("%C", letters.characterAtIndex(Int(rand))) } XCode says:
- Expected pattern
- Expected "," separator
- Expected "in" after for-each pattern
- Expected SequenceType expression for for-each loop
Changing the code with the proposed solutions doesn't change the exceptions thrown.
Any help is welcome to update the code to the current Swift version.