Проверка шаблона шины для iOS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
1.1KB

  1. // ВНИМАНИЕ Сгенерировано автоматом из файла %MODULE%.yml
  2. // ВНИМАНИЕ Не менять руками!
  3. %IMPORTS%
  4. // MARK: - Context
  5. public protocol %MODULE%Context {
  6. %CONTEXT_FIELDS%
  7. }
  8. // MARK: - Controller
  9. extension %MODULE% {
  10. final class Controller: MPAK.Controller<%MODULE%.Model> {
  11. init() {
  12. super.init(
  13. %MODULE%.Model(),
  14. debugClassName: "%MODULE_SHORT%Ctrl",
  15. debugLog: { aelog($0) }
  16. )
  17. }
  18. }
  19. %CORE%
  20. // MARK: - Model
  21. public struct Model: %MODULE%Context {
  22. %MODEL_FIELDS%
  23. }
  24. // MARK: - Service
  25. public final class Service {
  26. let ctrl = Controller()
  27. let world: World
  28. %SERVICE_CORE%
  29. var subscriptions = [AnyCancellable]()
  30. static private(set) weak var singleton: Service?
  31. public init(_ world: World) {
  32. self.world = world
  33. Self.singleton = self
  34. %SERVICE_SECTIONS%
  35. }
  36. }
  37. // MARK: - World
  38. public struct World {
  39. %WORLD_FIELDS%
  40. public init(
  41. %WORLD_PARAMETERS%
  42. ) {
  43. %WORLD_CONSTRUCTOR%
  44. }
  45. }
  46. enum SectionGenerated {
  47. %CORE_SECTION_GENERATED%
  48. %SERVICE_SECTION_GENERATED%
  49. }
  50. }