I have large list of objects and I need to split them in a group of two elements for UI propouse.
Example:
[0, 1, 2, 3, 4, 5, 6]
Becomes
The shortest solution (Swift 4), I have seen so far, is from a Gist:
extension Array { func chunks(chunkSize: Int) -> [[Element]] { return stride(from: 0, to: self.count, by: chunkSize).map { Array(self[$0..