Advertisement
drsgon13

TestView

Jun 5th, 2024
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.82 KB | None | 0 0
  1. struct TestView: View {
  2.     @Environment(\.presentationMode) var presentationMode
  3.     @State var testBool = false
  4.    
  5.     let chatRoom = TCP_Communicator()
  6.     var body: some View {
  7.             VStack {
  8.  
  9.             }.onAppear() {
  10.                 name = "localhost"
  11.             }
  12.     }
  13.    
  14.     func load() {
  15.         Вот пытался сделать переход
  16.         testBool.toggle()
  17.         _ = fullScreenCover(isPresented: $testBool, content: {
  18.                     TestOnlineView()
  19.                 })
  20.     }
  21.  
  22.     func submit() {
  23.         if(name != "") {
  24.             UserDefaults.standard.set(name, forKey: "ip_adres")
  25.             urlStr = URL(string: name)!
  26.             chatRoom.connect(url: urlStr, port: 2323)
  27.             chatRoom.send(message: json)
  28.             whImg = 200
  29.             showLoading = true
  30.         }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement