This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import _ from 'lodash'; | |
const originKey = '__origin'; | |
const traverseTree = (root, test) => { | |
let stack = [root]; | |
while (stack.length > 0) { | |
const node = stack.pop(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
#import <objc/runtime.h> | |
@interface UIStatusBar : NSObject @end | |
@implementation UIStatusBar (CustomColor) | |
+ (void)load | |
{ | |
static dispatch_once_t onceToken; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ (dispatch_block_t)performBlock:(void (^)(dispatch_block_t safeBlock))block | |
{ | |
dispatch_block_t strongBlock; | |
__weak __block dispatch_block_t weakBlock = strongBlock = ^{ | |
block(weakBlock); | |
}; | |
strongBlock(); | |
return strongBlock; | |
} |