Михаил Капелько hace 10 meses
padre
commit
8cd10b105d
Se han modificado 4 ficheros con 17 adiciones y 2 borrados
  1. +1
    -1
      src/App.swift
  2. +6
    -0
      src/MeetupId.yml
  3. +8
    -1
      src/V.swift
  4. +2
    -0
      src/VM.swift

+ 1
- 1
src/App.swift Ver fichero

@@ -12,7 +12,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate
window = UIWindow(frame: UIScreen.main.bounds)
let vc = UIViewController()
addSwiftUIViewAsChild(swiftUIView: V(), parent: vc.view)
vc.view.backgroundColor = .gray
vc.view.backgroundColor = .white
window?.rootViewController = vc
window?.backgroundColor = UIColor.white
window?.makeKeyAndVisible()


+ 6
- 0
src/MeetupId.yml Ver fichero

@@ -0,0 +1,6 @@
version: 2

model:
textApp: [String, ""]
textUI: [String, ""]


+ 8
- 1
src/V.swift Ver fichero

@@ -13,7 +13,14 @@ struct V: View {

TextField("Binding-3", value: $vm.text, formatter: TextFieldValueOwner())
.padding(8)
.border(Color.green, width: 4)
.border(Color.blue, width: 2)

Button(action: vm.join.send) {
Text("Join")
.padding(8)
.border(vm.isJoinAvailable ? Color.green : Color.red, width: 4)
}

}
.frame(width: 320)
.padding()


+ 2
- 0
src/VM.swift Ver fichero

@@ -8,6 +8,8 @@ final class VM: ObservableObject {
MeetupId.K.meetupIdTextApp.rawValue,
MeetupId.onlyFormat
)
var isJoinAvailable = true
let join = PassthroughSubject<Void, Never>()
var subscriptions = [AnyCancellable]()

init() {


Cargando…
Cancelar
Guardar