Create a main.swift file and conditionally load the production UIApplicationDelegate, returning nil if the tests are running.
// main.swift
import UIKit
private func delegateClassName() -> String? {
return NSClassFromString("XCTestCase") == nil ? NSStringFromClass(AppDelegate.self) : nil
}
UIApplicationMain(CommandLine.argc, CommandLine.unsafeArgv, nil, delegateClassName())