diff --git a/Modules/BusX/src/Bus.Aux.swift b/Modules/BusX/Bus/src/Bus.Aux.swift similarity index 86% rename from Modules/BusX/src/Bus.Aux.swift rename to Modules/BusX/Bus/src/Bus.Aux.swift index 012a325..79804e1 100644 --- a/Modules/BusX/src/Bus.Aux.swift +++ b/Modules/BusX/Bus/src/Bus.Aux.swift @@ -8,9 +8,6 @@ public extension Bus { key == v.key, let value = v.value as? T else { - if key == "MeetupId.finishLoading" { - /**/print("ИГР Bus.convertKV failed k/v/T: '\(key)'/'\(v)'/'\(type(of: T.self))'") - } return nil } return (key, value) diff --git a/Modules/BusX/src/Bus.Processor.swift b/Modules/BusX/Bus/src/Bus.Processor.swift similarity index 100% rename from Modules/BusX/src/Bus.Processor.swift rename to Modules/BusX/Bus/src/Bus.Processor.swift diff --git a/Modules/BusX/src/Bus.swift b/Modules/BusX/Bus/src/Bus.swift similarity index 97% rename from Modules/BusX/src/Bus.swift rename to Modules/BusX/Bus/src/Bus.swift index b1e2fde..90c9d85 100644 --- a/Modules/BusX/src/Bus.swift +++ b/Modules/BusX/Bus/src/Bus.swift @@ -20,7 +20,6 @@ extension Bus { var subscriptions = [AnyCancellable]() func send(_ key: String, _ value: Any) { - /**/print("ИГР BusS.send key/value: '\(key)'/'\(value)'") events.send((key, value)) } } diff --git a/Modules/CordX/src/Cord.Onlys.swift b/Modules/BusX/BusUI/src/BusUI.Aux.swift similarity index 93% rename from Modules/CordX/src/Cord.Onlys.swift rename to Modules/BusX/BusUI/src/BusUI.Aux.swift index d616677..72d3261 100644 --- a/Modules/CordX/src/Cord.Onlys.swift +++ b/Modules/BusX/BusUI/src/BusUI.Aux.swift @@ -1,4 +1,4 @@ -extension Cord { +extension BusUI { /// Пропускаем лишь значения от UI /// /// - Returns: Значение без префиксов "a:"/"u:" diff --git a/Modules/CordX/src/Cord.Button.swift b/Modules/BusX/BusUI/src/BusUI.Button.swift similarity index 91% rename from Modules/CordX/src/Cord.Button.swift rename to Modules/BusX/BusUI/src/BusUI.Button.swift index 41fb1be..7b1186b 100644 --- a/Modules/CordX/src/Cord.Button.swift +++ b/Modules/BusX/BusUI/src/BusUI.Button.swift @@ -1,7 +1,6 @@ -import BusX import Combine -extension Cord { +extension BusUI { public final class Button: ObservableObject { public let v = PassthroughSubject() var subscriptions = [AnyCancellable]() diff --git a/Modules/CordX/src/Cord.TextField.swift b/Modules/BusX/BusUI/src/BusUI.TextField.swift similarity index 95% rename from Modules/CordX/src/Cord.TextField.swift rename to Modules/BusX/BusUI/src/BusUI.TextField.swift index d5c8126..174421e 100644 --- a/Modules/CordX/src/Cord.TextField.swift +++ b/Modules/BusX/BusUI/src/BusUI.TextField.swift @@ -1,8 +1,7 @@ -import BusX import Combine import SwiftUI -extension Cord { +extension BusUI { public final class TextField: ObservableObject { @Published public var v = "a:" var subscriptions = [AnyCancellable]() diff --git a/Modules/CordX/src/Cord.TextFieldValueOwner.swift b/Modules/BusX/BusUI/src/BusUI.TextFieldSource.swift similarity index 58% rename from Modules/CordX/src/Cord.TextFieldValueOwner.swift rename to Modules/BusX/BusUI/src/BusUI.TextFieldSource.swift index 8d470ce..80230a0 100644 --- a/Modules/CordX/src/Cord.TextFieldValueOwner.swift +++ b/Modules/BusX/BusUI/src/BusUI.TextFieldSource.swift @@ -1,12 +1,15 @@ import Foundation -extension Cord { - public final class TextFieldValueOwner: Formatter { +extension BusUI { + public final class TextFieldSource: Formatter { + /// Выдаём для отображения очищенную от источника строку. public override func string(for obj: Any?) -> String? { guard let str = obj as? String else { return nil } return String(str.dropFirst(2)) } + /// Выдаём для использования кодом строку с указанием источника + /// в виде пользователя `u:` public override func getObjectValue( _ obj: AutoreleasingUnsafeMutablePointer?, for string: String, diff --git a/Modules/CordX/src/Cord.Receive.swift b/Modules/BusX/BusUI/src/BusUI.Value.swift similarity index 79% rename from Modules/CordX/src/Cord.Receive.swift rename to Modules/BusX/BusUI/src/BusUI.Value.swift index 4fe686b..0e4c142 100644 --- a/Modules/CordX/src/Cord.Receive.swift +++ b/Modules/BusX/BusUI/src/BusUI.Value.swift @@ -1,8 +1,7 @@ -import BusX import Combine -extension Cord { - public final class Receive: ObservableObject { +extension BusUI { + public final class Value: ObservableObject { @Published public var v: T var subscriptions = [AnyCancellable]() diff --git a/Modules/BusX/BusUI/src/BusUI.swift b/Modules/BusX/BusUI/src/BusUI.swift new file mode 100644 index 0000000..9c2ef3b --- /dev/null +++ b/Modules/BusX/BusUI/src/BusUI.swift @@ -0,0 +1 @@ +public enum BusUI { } diff --git a/Modules/BusX/BusX.podspec b/Modules/BusX/BusX.podspec index 5f7eee6..62b1ee1 100644 --- a/Modules/BusX/BusX.podspec +++ b/Modules/BusX/BusX.podspec @@ -1,13 +1,13 @@ Pod::Spec.new do |s| s.name = 'BusX' -s.version = '2023.12.28' +s.version = '2023.12.30' s.license = 'IVCS' s.summary = 'Шина общения элементов приложения' s.homepage = 'IVCS' s.author = 'IVCS' s.source = { :git => 'https://fake.com/FAKE.git', :tag => s.version } -s.source_files = 'src/**/*.swift' +s.source_files = '**/**/*.swift' s.swift_version = '5.2' s.ios.deployment_target = '14.0' diff --git a/Modules/BusX/src/unused b/Modules/BusX/src/unused deleted file mode 100644 index 256f9df..0000000 --- a/Modules/BusX/src/unused +++ /dev/null @@ -1,30 +0,0 @@ -import Combine - -public extension Bus { - final class Receiver { - var subscriptions = [AnyCancellable]() - - public init( - _ keys: Set, - _ handler: @escaping ((String, T) -> Void), - opt: [Option] = [] - ) { - Bus.receive(keys, handler, opt: opt, sub: &subscriptions) - } - } -} -import Combine - -public extension Bus { - final class Sender { - var subscriptions = [AnyCancellable]() - - public init( - _ key: String, - _ node: AnyPublisher, - opt: [Option] = [] - ) { - Bus.send(key, node, opt: opt, sub: &subscriptions) - } - } -} diff --git a/Modules/CordX/CordX.podspec b/Modules/CordX/CordX.podspec deleted file mode 100644 index 5669254..0000000 --- a/Modules/CordX/CordX.podspec +++ /dev/null @@ -1,15 +0,0 @@ -Pod::Spec.new do |s| - -s.name = 'CordX' -s.version = '2023.12.29' -s.license = 'IVCS' -s.summary = 'Упрощённое общение с шиной из SwiftUI' -s.homepage = 'IVCS' -s.author = 'IVCS' -s.source = { :git => 'https://fake.com/FAKE.git', :tag => s.version } -s.source_files = 'src/**/*.swift' -s.swift_version = '5.2' -s.ios.deployment_target = '14.0' -s.dependency 'BusX' - -end diff --git a/Modules/CordX/src/Cord.swift b/Modules/CordX/src/Cord.swift deleted file mode 100644 index f050533..0000000 --- a/Modules/CordX/src/Cord.swift +++ /dev/null @@ -1 +0,0 @@ -public enum Cord { } diff --git a/Modules/MeetupIdX/MeetupIdX.podspec b/Modules/MeetupIdX/MeetupIdX.podspec index 763196a..fa2f860 100644 --- a/Modules/MeetupIdX/MeetupIdX.podspec +++ b/Modules/MeetupIdX/MeetupIdX.podspec @@ -12,7 +12,6 @@ s.swift_version = '5.2' s.ios.deployment_target = '14.0' s.dependency 'AELog' s.dependency 'BusX' -s.dependency 'CordX' s.dependency 'MPAKX' end diff --git a/Modules/MeetupIdX/src/MeetupId.Generated.swift b/Modules/MeetupIdX/src/MeetupId.Generated.swift index 1cd7fcc..ddbe8c0 100644 --- a/Modules/MeetupIdX/src/MeetupId.Generated.swift +++ b/Modules/MeetupIdX/src/MeetupId.Generated.swift @@ -4,7 +4,6 @@ import AELog import BusX import Combine -import CordX import Foundation import MPAKX import UIKit diff --git a/Modules/MeetupIdX/src/MeetupId.V.swift b/Modules/MeetupIdX/src/MeetupId.V.swift index 7750fc6..99dd1b7 100644 --- a/Modules/MeetupIdX/src/MeetupId.V.swift +++ b/Modules/MeetupIdX/src/MeetupId.V.swift @@ -1,13 +1,12 @@ import BusX -import CordX import SwiftUI extension MeetupId { public struct V: View { - @StateObject var isJoinAvailable = Cord.Receive(K.isJoinAvailable, false) - @StateObject var isLoading = Cord.Receive(K.isLoading, false) - @StateObject var join = Cord.Button(K.join) - @StateObject var textField = Cord.TextField(K.textApp, K.textUI) + @StateObject var isJoinAvailable = BusUI.Value(K.isJoinAvailable, false) + @StateObject var isLoading = BusUI.Value(K.isLoading, false) + @StateObject var join = BusUI.Button(K.join) + @StateObject var textField = BusUI.TextField(K.textApp, K.textUI) let processors: [Any] = [ Bus.Processor(shouldEnableJoin, K.M, K.isJoinAvailable), MeetupId.Debounce(0.2, formatId, K.textUI, K.textApp), @@ -19,7 +18,7 @@ extension MeetupId { public var body: some View { VStack(spacing: 8) { HStack { - TextField("Binding-3", value: $textField.v, formatter: Cord.TextFieldValueOwner()) + TextField("Binding-3", value: $textField.v, formatter: BusUI.TextFieldSource()) .disabled(isLoading.v) .padding(8) .border( diff --git a/app/Podfile b/app/Podfile index cb05c9a..07c0d57 100644 --- a/app/Podfile +++ b/app/Podfile @@ -5,7 +5,6 @@ platform :ios, '14.0' pod 'AELog' pod 'BusX', :path => '../Modules/BusX' -pod 'CordX', :path => '../Modules/CordX' pod 'MeetupIdX', :path => '../Modules/MeetupIdX' pod 'MPAKX', :path => '../Modules/MPAKX' diff --git a/app/Podfile.lock b/app/Podfile.lock index 5ba5278..a90b1f1 100644 --- a/app/Podfile.lock +++ b/app/Podfile.lock @@ -1,19 +1,15 @@ PODS: - AELog (0.6.3) - - BusX (2023.12.28) - - CordX (2023.12.29): - - BusX + - BusX (2023.12.30) - MeetupIdX (2023.12.28): - AELog - BusX - - CordX - MPAKX - MPAKX (2023.12.15) DEPENDENCIES: - AELog - BusX (from `../Modules/BusX`) - - CordX (from `../Modules/CordX`) - MeetupIdX (from `../Modules/MeetupIdX`) - MPAKX (from `../Modules/MPAKX`) @@ -24,8 +20,6 @@ SPEC REPOS: EXTERNAL SOURCES: BusX: :path: "../Modules/BusX" - CordX: - :path: "../Modules/CordX" MeetupIdX: :path: "../Modules/MeetupIdX" MPAKX: @@ -33,11 +27,10 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: AELog: f732b70f7a9d1b4c6a3676304192b3908f362133 - BusX: fd22c04ad544d131e66315c1a33d87d85b19712e - CordX: f8ba6a8db42f9f27142948b536b9b8272f9b977c - MeetupIdX: b214163e32acffd0a5283062e9d69aaf5a5b66e6 + BusX: d11e857e9cb762f649ee9f88fd5a4f8fbf5bf96b + MeetupIdX: 80e2257016a043b10dd77e1e9a59d083bef21323 MPAKX: dc592434f55edf34709f6e4f37c9ec90dcd95185 -PODFILE CHECKSUM: 35ca81ffde7ba64c51870ff39b799f407bf0fbde +PODFILE CHECKSUM: ff31073a9b868750f1cfabf6c1c740dbf32d4cb1 COCOAPODS: 1.13.0