// // AppDelegate.swift // Chat (iOS) // // Created by Sergey Tarasov on 09.10.2022. // import UIKit import SwiftUI import XMPPFramework @main class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? var rootViewController: UIViewController? func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil ) -> Bool { let loginStore: LoginStore = LoginStore { [weak self] login, password in XMPPController.shared.login(with: login, and: password) XMPPController.shared.connect() self?.rootViewController = UIHostingController(rootView: ContentView()) self?.window?.rootViewController = self?.rootViewController } let loginView: LoginView = LoginView(store: loginStore) rootViewController = UIHostingController(rootView: loginView) window = UIWindow(frame: UIScreen.main.bounds) window?.rootViewController = rootViewController window?.makeKeyAndVisible() DDLog.add(DDOSLogger.sharedInstance, with: DDLogLevel.all) return true } }