You know how we can have a different AppDelegate for running unit tests? Has anyone figured out setting up a different AppDelegate for Xcode Previews?
@danielkasaj For unit tests, you can create a main.swift file with an implementation like this. The return value is optional as they work without an AppDelegate, so you can also return nil
@lajosdavid maybe my english isn’t good enough, but I am looking for a similar solution for Xcode Previews. I’ve got a stuffed AppDelegate that I cannot avoid but none of the Previews need its stuffing

@danielkasaj Since you mentioned the unit tests, I thought you needed that too.

For previews, you can check the environment value "XCODE_RUNNING_FOR_PREVIEWS" on the running process. Here you can find a detailed guide how to use it:
https://sarunw.com/posts/detecting-xcode-previews

Detecting if SwiftUI app is in Xcode Previews | Sarunw

Learn how to detect whether an app is running in Xcode Previews.

Sarunw
@lajosdavid Thanks so much, this is exactly what I have been looking for even though I went looking for it the wrong way 😁