react-native-navigation的迁移库

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #import "RNNLayoutNode.h"
  2. @implementation RNNLayoutNode
  3. +(instancetype)create:(NSDictionary *)json
  4. {
  5. RNNLayoutNode* node = [RNNLayoutNode new];
  6. node.type = json[@"type"];
  7. node.nodeId = json[@"id"];
  8. node.data = json[@"data"];
  9. node.children = json[@"children"];
  10. return node;
  11. }
  12. -(BOOL)isComponent
  13. {
  14. return [self.type isEqualToString:@"Component"];
  15. }
  16. -(BOOL)isExternalComponent
  17. {
  18. return [self.type isEqualToString:@"ExternalComponent"];
  19. }
  20. -(BOOL)isStack
  21. {
  22. return [self.type isEqualToString:@"Stack"];
  23. }
  24. -(BOOL)isTabs
  25. {
  26. return [self.type isEqualToString:@"BottomTabs"];
  27. }
  28. -(BOOL)isTopTabs
  29. {
  30. return [self.type isEqualToString:@"TopTabs"];
  31. }
  32. -(BOOL)isSideMenuRoot
  33. {
  34. return [self.type isEqualToString:@"SideMenuRoot"];
  35. }
  36. -(BOOL)isSideMenuLeft
  37. {
  38. return [self.type isEqualToString:@"SideMenuLeft"];
  39. }
  40. -(BOOL)isSideMenuRight
  41. {
  42. return [self.type isEqualToString:@"SideMenuRight"];
  43. }
  44. -(BOOL)isSideMenuCenter
  45. {
  46. return [self.type isEqualToString:@"SideMenuCenter"];
  47. }
  48. -(BOOL)isSplitView
  49. {
  50. return [self.type isEqualToString:@"SplitView"];
  51. }
  52. @end