Long press to reorder items in a UITableViewController in Swift 3

I recently wanted to add long press to reorder to a new app I’m building, but most of the examples I found online were either in Objective-C or an outdated version of Swift, so I decided I would update this for Swift 3.0. First, we’ll add a function to create an enlarged snapshot of our cell for us to drag …

Functional Swift

Map Map applies a function to every element in the array, and then returns a new array, such as:

Functionally, you can implement this with map as such:

Flatten Flatten flattens out nested arrays, and unwraps optionals.

FlatMap FlatMap does Map, then Flatten.

Reduce Reduce takes an initial value, and a combine function, and combines all …