No, Your Eyes Didn’t Lie, the Title Is Not a Typo

You may have heard of functioning programming or higher-order functions, like mapfilterreduceflatMap, etc., for Swift. Trust me, if you start to use them in your projects today, you will love them. The approach to use functions as arguments in another function is so handy and succinct that it’s very addictive and hard to reject.

And, what about Objective-C? Are we able to take the same ideas or similar manners in it? Yes, we can. We can create an NSArray category and iterate each element of it to achieve an identical result. In this article, I’ll demonstrate how to create block based functions for mapfilterreduce and flatMap in Objective-C.

#swift #xcode #ios #objective-c

Higher Order Functions in Objective-C
4.35 GEEK