Drop me an email if you'd like to hire me (part time) or learn more about what I do. You can read about my experience and references on LinkedIn.
Swift: Detach completion handler of a method to a function
I think it is worth to share, I show it to my coworker and he likes it.
Sometimes we need to perform a big chunk of work to do in a completion handler
of a function, like completion handler in a get/post network request. Usually
we do it in a block that can get really messy. Here is a simplified example.
The other option you can handle completion block is to pass a function instead
of a block. As we know, closures are functions without names, or differently,
functions are closures with names :)