react-native-navigation的迁移库

123456789101112131415161718192021222324
  1. #import <Foundation/Foundation.h>
  2. extern BOOL RNNIsMainQueue(void);
  3. #ifndef RNN_NSASSERT
  4. #define RNN_NSASSERT RCT_DEBUG
  5. #endif
  6. #ifndef NS_BLOCK_ASSERTIONS
  7. #define RNNAssert(condition, ...) do { \
  8. if ((condition) == 0) { \
  9. if (RNN_NSASSERT) { \
  10. [[NSAssertionHandler currentHandler] handleFailureInFunction:(NSString * _Nonnull)@(__func__) \
  11. file:(NSString * _Nonnull)@(__FILE__) lineNumber:__LINE__ description:__VA_ARGS__]; \
  12. } \
  13. } \
  14. } while (false)
  15. #else
  16. #define RNNAssert(condition, ...) do {} while (false)
  17. #endif
  18. #define RNNAssertMainQueue() RNNAssert(RNNIsMainQueue(), \
  19. @"This function must be called on the main queue")