3. Making Things Happen: Functions

This chapter discusses functions. You will find that Swift functions are based on the best implementations functions in other languages. Swift functions provide you with lots of flexibility to create parameters that are both “internal” and “external,” which jives well with Objective-C. Internal and external parameters allow you to have functions that are easy to read. You’ll be able to quickly read the name of a function and know exactly what it does. This is one excellent feature of Objective-C that has made its way into Swift.

A function itself can also be passed as a parameter of another function, also known as anonymous functions. This makes it easy to pass parameters around to different contexts. Functions ...

Get Learning Swift™ Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.