I recently came across a useful Objective-C library on Github. The library skillfully used "$" to denote it...">
- macros πŸ›΅ 🧦 πŸ••

C Objective Macro Library That Uses '$'

I recently came across a useful Objective-C library on Github. The library skillfully used "$" to denote its macros. For example, $ dict (key1, obj1, key2, obj2) will return an NSDictionary with the corresponding keys and values.

Do you know the name of this library and its Github url?

+4
source share
3 answers

I don’t know which specific library you are discussing, but I have some similar macros, and I invite you to add along these lines:

#define $array(objs...) [NSArray arrayWithObjects: objs, nil] #define $set(objs...) [NSSet setWithObjects: objs, nil] #define $format(format, objs...) [NSString stringWithFormat: format, objs] 

It also defines $ rect, $ point, $ size, etc.

https://github.com/peterdeweese/es_ios_utils/blob/master/es_ios_utils

+4
source

There's also Jens Ayton JANumberLiteral , which uses the same syntax, but specifically for NSNumbers.

+2
source

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


All Articles