I have the following loop in my Swift code:
for var i:Int = 0, j:Int = 0; i < rawDataOut.count; i += 4, ++j {
maskPixels[j] = rawDataOut[i + 3]
}
I'm getting two warnings in Xcode:
- C-style for statement is deprecated and will be removed in a future version of Swift
- '++' is deprecated: it will be removed in Swift 3
I cannot see how to rewrite this in Swift's For In Loops to take into account the two variables and the 4-stride without it getting messy. Is there a simple elegant translation?