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
#define RTObjectKeyPath(OBJ, PATH) (((void)(NO && ((void)(((typeof(OBJ))nil).PATH), NO)), @# PATH)) |
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
@interface NSString (ComposedCharacter) | |
/** | |
* @description @b NSString use UTF-16 encode to store characters internally, in | |
* most cast, the @c length of a @b NSString is the number visible characters. | |
* But not for some special Characters like Emoji. | |
* @"😃🤡⛹🏿♀️⚫️🤥🤕💪🏾" this @b NSString only has 7 Emojis, but its @c length is | |
* 20. Sometimes we only want the human visible charater count. | |
* | |
* @code |
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
#define __mz_macro_concat(A, B) __mz_macro_concat_(A, B) | |
#define __mz_macro_argcount(...) __mz_macro_at(6, __VA_ARGS__, 6, 5, 4, 3, 2, 1) | |
#define __mz_macro_head(...) __mz_macro_head_(__VA_ARGS__, 0) | |
#define __mz_macro_at(N, ...) __mz_macro_concat(__mz_macro_at, N)(__VA_ARGS__) | |
#define __mz_macro_at0(...) __mz_macro_head(__VA_ARGS__) | |
#define __mz_macro_at1(_0, ...) __mz_macro_head(__VA_ARGS__) | |
#define __mz_macro_at2(_0, _1, ...) __mz_macro_head(__VA_ARGS__) | |
#define __mz_macro_at3(_0, _1, _2, ...) __mz_macro_head(__VA_ARGS__) | |
#define __mz_macro_at4(_0, _1, _2, _3, ...) __mz_macro_head(__VA_ARGS__) |
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
- (UIImage *)mz_convertToSRGBColorSpace | |
{ | |
UIImage *newImage = self; | |
do { | |
CGImageRef CGImage = self.CGImage; | |
CGColorSpaceRef srcSpace = CGImageGetColorSpace(CGImage); | |
CGColorSpaceRef dstSpace = IS_IOS_9 ? CGColorSpaceCreateWithName(kCGColorSpaceSRGB) : CGColorSpaceCreateDeviceRGB(); | |
// 颜色空间一样直接返回 self | |
if (CFEqual(srcSpace, CFAutorelease(CGColorSpaceCreateDeviceRGB())) || |
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 <Foundation/Foundation.h> | |
@class RTRouter; | |
typedef void(^RTRouteCompleteBlock)(void); | |
@protocol RTRoutable <NSObject> | |
@optional | |
+ (BOOL)routerDidRoutePattern:(NSString *)pattern | |
withParameters:(id)parameters |
NewerOlder