EaseEmoji.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /************************************************************
  2. * * Hyphenate CONFIDENTIAL
  3. * __________________
  4. * Copyright (C) 2016 Hyphenate Inc. All rights reserved.
  5. *
  6. * NOTICE: All information contained herein is, and remains
  7. * the property of Hyphenate Inc.
  8. * Dissemination of this information or reproduction of this material
  9. * is strictly forbidden unless prior written permission is obtained
  10. * from Hyphenate Inc.
  11. */
  12. #import <Foundation/Foundation.h>
  13. #define MAKE_Q(x) @#x
  14. #define MAKE_EM(x,y) MAKE_Q(x##y)
  15. #pragma clang diagnostic push
  16. #pragma clang diagnostic ignored "-Wunicode"
  17. #define MAKE_EMOJI(x) MAKE_EM(\U000,x)
  18. #pragma clang diagnostic pop
  19. #define EMOJI_METHOD(x,y) + (NSString *)x { return MAKE_EMOJI(y); }
  20. #define EMOJI_HMETHOD(x) + (NSString *)x;
  21. #define EMOJI_CODE_TO_SYMBOL(x) ((((0x808080F0 | (x & 0x3F000) >> 4) | (x & 0xFC0) << 10) | (x & 0x1C0000) << 18) | (x & 0x3F) << 24);
  22. @interface EaseEmoji : NSObject
  23. + (NSString *)emojiWithCode:(int)code;
  24. + (NSArray *)allEmoji;
  25. + (BOOL)stringContainsEmoji:(NSString *)string;
  26. @end