flatMap deprecated (Swift 4.2) ?
Hi, what would be the function to achieve the same result as the one obtained with
flatMap ? i.e.: flattening an array of arrays to an array ?
Rogier NitschelmiOS Development Techdegree Student 5,461 Points
In Swift there were a few use-cases for using flatMap. Removing nil-values from an array. And flattening an array of arrays for example.
Removing nil-values with flatMap is being deprecated. Instead you can use
.compactMap for that. You can still use
flatMap to flatten an array of arrays.