中文文档请移步 中文文档
RAC block @weakify & @strongify easy to use
BlockMacroUnit is a tool used for those non-RAC-support project. RAC has a great feature (@weakify & @strongify) to increase coding speed and experience.
if not use BlockMacroUnit you will code like this
__weak __typeof__(self) weakSelf = self;
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
__strong __typeof(self) strongSelf = weakSelf;
[strongSelf doSomething];
[strongSelf doOtherThing];
);
but after you import BlockMacroUnit , you can code like this
#import "BlockMarco.h"
@weakify(self)
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
@strongify(self)
[self doSomething];
[self doOtherThing];
});
if any question ,mail me please. email : [email protected]