Use Custom UIApplication Subclass with SwiftUI

I have a SwiftUI app which needs the Ivanti AppConnect SDK. The docs only show how to integrate it into a Swift/UIKit app. But I need it to work with SwiftUI. I probably could make a UIKit base app and then load my existing SwiftUI views and code through a SwiftUI component host or something. But I'd like to avoid that if possible.

Here is where I'm stuck:

The AppConnect framework loads through a custom UIApplication subclass in the main.swift file:

import Foundation
import AppConnect

UIApplicationMain(
    CommandLine.argc,
    CommandLine.unsafeArgv,
    ACUIApplicationClassName,
    NSStringFromClass(AppDelegate.self)
)

The startup works as expected, and the expected function is called in the AppDelegate class:

func application(
   _ application: UIApplication, 
   didFinishLaunchingWithOptions launchOptions: 
      [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {...}

However, the SwiftUI view is not loaded and the scree stays blank. I implemented a SceneDelegate.swift class which doesn't seem to be called.

Also, the following function in the AppDelegate doesn't get called either:

func application(
   _ application: UIApplication, 
   configurationForConnecting connectingSceneSession: UISceneSession, 
   options: UIScene.ConnectionOptions) -> UISceneConfiguration {...}

So how do I bootstrap SwiftUI with a custom UIApplication class? can that be done with the @main macro somehow?

I'm still pretty new to Swift and iOS development. Any help is appreciated

Use Custom UIApplication Subclass with SwiftUI
 
 
Q