react-native-navigation的迁移库

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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)isContainer
  13. {
  14. return [self.type isEqualToString:@"Container"];
  15. }
  16. -(BOOL)isContainerStack
  17. {
  18. return [self.type isEqualToString:@"ContainerStack"];
  19. }
  20. -(BOOL)isTabs
  21. {
  22. return [self.type isEqualToString:@"BottomTabs"];
  23. }
  24. -(BOOL)isTopTabs
  25. {
  26. return [self.type isEqualToString:@"TopTabs"];
  27. }
  28. -(BOOL)isTopTab
  29. {
  30. return [self.type isEqualToString:@"TopTab"];
  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. @end