react-native-navigation的迁移库

LayoutCreator.m 758B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #import "LayoutCreator.h"
  2. @implementation LayoutCreator
  3. + (NSDictionary *)component:(NSString *)componentId options:(NSDictionary *)options {
  4. return @{
  5. @"type": @"Component",
  6. @"id": componentId,
  7. @"data": @{
  8. @"options": options
  9. }
  10. };
  11. }
  12. + (NSDictionary *)parentWithID:(NSString *)componentId type:(NSString *)type options:(NSDictionary *)options children:(NSArray<NSDictionary *> *)children {
  13. return @{
  14. @"type": type,
  15. @"id": componentId,
  16. @"data": @{
  17. @"options": options
  18. },
  19. @"children": children
  20. };
  21. }
  22. + (NSDictionary *)stack:(NSDictionary *)options children:(NSArray<NSDictionary *> *)children {
  23. return @{
  24. @"type": @"Stack",
  25. @"id": @"StackID",
  26. @"data": @{
  27. @"options": options
  28. },
  29. @"children": children
  30. };
  31. }
  32. @end