First Class Functions in Swift

This is often spoken about in terms of Swift. But what is it?

Photo by Norman Toth on Unsplash

Terminology

Passing Functions

The problem

Click for Gist

The completion handler

Click for Gist

Assign functions to variables

Click for Gist

A fun example — the calculator

Click for Gist

Conclusion

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store