This commit is contained in:
Михаил Капелько
2023-12-28 14:04:37 +03:00
parent d893364ff4
commit 853686f441
5 changed files with 124 additions and 170 deletions

View File

@@ -3,7 +3,7 @@ Pod::Spec.new do |s|
s.name = 'MeetupIdX'
s.version = '2023.12.28'
s.license = 'IVCS'
s.summary = 'Окно ввода ID мероприятия'
s.summary = 'Ввод ID мероприятия'
s.homepage = 'IVCS'
s.author = 'IVCS'
s.source = { :git => 'https://fake.com/FAKE.git', :tag => s.version }

View File

@@ -0,0 +1,115 @@
// ВНИМАНИЕ Сгенерировано автоматом из файла MeetupId.yml
// ВНИМАНИЕ Не менять руками!
import BusX
import Combine
import CordX
import Foundation
import UIKit
// MARK: - Context
public protocol MeetupIdContext {
var textApp: MPAK.Recent<String> { get }
var textUI: MPAK.Recent<String> { get }
}
// MARK: - Controller
extension MeetupId {
final class Controller: MPAK.Controller<MeetupId.Model> {
init() {
super.init(
MeetupId.Model(),
debugClassName: "MeetupICtrl",
debugLog: { aelog($0) }
)
}
}
// MARK: - Model
public struct Model: MeetupIdContext {
public var textApp: MPAK.Recent<String> = .init("")
public var textUI: MPAK.Recent<String> = .init("")
}
// MARK: - Service
public final class Service {
let ctrl = Controller()
let world: World
var subscriptions = [AnyCancellable]()
static private(set) weak var singleton: Service?
public init(_ world: World) {
self.world = world
Self.singleton = self
SectionGenerated.setupPlatform(ctrl, self, world)
}
}
// MARK: - World
public struct World {
let textApp = PassthroughSubject<String, Never>()
let textUI = PassthroughSubject<String, Never>()
public init(
) {
}
}
enum SectionGenerated {
// MARK: - SectionGenerated Service
static func setupPlatform(
_ ctrl: Controller,
_ service: Service,
_ world: World
) {
// MARK: - SectionGenerated Service Actions
// MARK: - SectionGenerated Service Pipes
ctrl.pipeValue(
dbg: "textA",
sub: nil,
K.meetupIdTextApp.eraseToAnyPublisher(),
{
$0.textApp.value = $1
$0.textApp.isRecent = true
},
{ m, _ in m.textApp.isRecent = false }
)
ctrl.pipeValue(
dbg: "textUI",
sub: nil,
K.meetupIdTextUI.eraseToAnyPublisher(),
{
$0.textUI.value = $1
$0.textUI.isRecent = true
},
{ m, _ in m.textUI.isRecent = false }
)
}
}
}