C Lenses in Blocks

Despite its name, this question does not seem to affect it.

Is it possible to use Objective-C generics with blocks?

Sort of:

typedef void (^MyResultBlock<__covariant ObjectType>)(NSArray<ObjectType> *items);

... and then declare a block:

MyResultBlock<NSNumber> blockName = ^void(NSArray<NSNumber> *items) {...};
+4
source share
1 answer

No. Objective-C generics are for classes only, not typedefs.

+4
source

Source: https://habr.com/ru/post/1627286/


All Articles