1
0

SceneBuilder.swift.gyb 923 B

123456789101112131415161718192021222324252627282930
  1. // This file was generated using gyb. Do not edit it directly. Edit
  2. // SceneBuilder.swift.gyb instead.
  3. // swiftformat:options --allow-partial-wrapping true
  4. %{
  5. maximum_scene_count = 20
  6. }%
  7. /// Builds an app's root scene by composing other scenes together.
  8. @resultBuilder
  9. public struct SceneBuilder {
  10. /// A single scene doesn't need to get wrapped, simply pass it straight through.
  11. public static func buildBlock<Content: Scene>(_ content: Content) -> Content {
  12. return content
  13. }
  14. %for i in range(2, maximum_scene_count + 1):
  15. public static func buildBlock<
  16. ${", ".join("Scene%d: Scene" % j for j in range(i))}
  17. >(
  18. ${", ".join("_ scene%d: Scene%d" % (j, j) for j in range(i))}
  19. ) -> TupleScene${i}<
  20. ${", ".join("Scene%d" % j for j in range(i))}
  21. > {
  22. return TupleScene${i}(
  23. ${", ".join("scene%d" % j for j in range(i))}
  24. )
  25. }
  26. %end
  27. }