1234567891011121314151617181920212223242526272829303132333435363738394041 |
- //
- // 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
- }
- }
|