30 lines
701 B
Swift
30 lines
701 B
Swift
import monalxmpp
|
|
import SwiftUI
|
|
|
|
@main
|
|
struct AnotherIMApp: App {
|
|
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
|
|
@StateObject var wrapper = MonalXmppWrapper()
|
|
|
|
init() {
|
|
DDLog.add(DDOSLogger.sharedInstance, with: .all)
|
|
}
|
|
|
|
var body: some Scene {
|
|
WindowGroup {
|
|
RootView()
|
|
.environmentObject(wrapper)
|
|
}
|
|
}
|
|
}
|
|
|
|
class AppDelegate: UIResponder, UIApplicationDelegate {
|
|
func applicationWillEnterForeground(_: UIApplication) {
|
|
MLXMPPManager.sharedInstance().nowForegrounded()
|
|
}
|
|
|
|
func applicationDidEnterBackground(_: UIApplication) {
|
|
MLXMPPManager.sharedInstance().nowBackgrounded()
|
|
}
|
|
}
|