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
You can use oisdk's awesome SwiftSequence framework. There is the chunk function which does exactly what you want:
[1, 2, 3, 4, 5].chunk(2)
[[1, 2], [3, 4], [5]]
Also there's a LOT more functions for sequences, you should definitely check it out.
You can have a look at his implementation of chunk here (It uses generators)