Проверка шаблона шины для 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.

file 1.1KB

11 months ago
10 months ago
11 months ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 any = [Any]()
  30. var subscriptions = [AnyCancellable]()
  31. static private(set) weak var singleton: Service?
  32. public init(_ world: World) {
  33. self.world = world
  34. Self.singleton = self
  35. %SERVICE_SECTIONS%
  36. }
  37. }
  38. // MARK: - World
  39. public struct World {
  40. %WORLD_FIELDS%
  41. public init(
  42. %WORLD_PARAMETERS%
  43. ) {
  44. %WORLD_CONSTRUCTOR%
  45. }
  46. }
  47. enum SectionGenerated {
  48. %CORE_SECTION_GENERATED%
  49. %SERVICE_SECTION_GENERATED%
  50. }
  51. }