Although this is not explicitly stated, it seems to be happening as per the examples in the documentation
let array = [0, 1, 2, 3, 4, 5, 6, 7] let filteredArray = array.filter { $0 % 2 == 0 } // filteredArray is [0, 2, 4, 6]
Massive manipulation methods tend to maintain order in all directions when it makes sense, and he is here. I would be very surprised if he did not return in the same order. But again, since this is not explicitly mentioned, it might be a good idea to write a check in the form of an assertion in case they change it line by line.
source share