What is block in objective c?
1629
09-Jan-2017
Updated on 14-Sep-2020
Allen Scott
09-Jan-2017Blocks are language-level feature that added to C, Objective-C and C++, which provides you to create distinct segments of code that can be passed to methods or functions as if they were values. Blocks are Objective-C objects, so we can add it to collections like NSArray or NSDictionary. Blocks can capture values from the enclosing scope,so this features make blocks similar to closures or lambdas in other programming languages such as java and c#.