Cracking The iOS Interview 170988321

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Cracking the

iOS Interview
Questions
swiftanytime.com/cracking-the-ios-interview
What are H̀igher Order Functions in
Swift?
These are functions that take other
functions or closures as arguments
and that return a function or a
closure.
Some most commonly used Higher
Order Functions are,

1. Map
2. Filter
3. Reduce
1. Map

This function performs an


operation on all the elements
of a collection and returns a
new collection with the results
of the operation on the original
elements.
Map Code Example
2. Filter

This function is used to filter


the elements of a collection
based on a condition and
produce a new one containing
only those elements that
satisfy the condition.
Filter Code Example
3. Reduce

This function is used to


produce one value from the
values of all elements in a
collection.
Reduce Code Example
Thank You for reading!

We have made a comprehensive


Guide to Cracking the iOS Interview
which will help you ace your next
iOS Interview

Grab your copy now!


swiftanytime.com/cracking-the-ios-interview

You might also like