Created
April 6, 2017 21:20
-
-
Save jaylyerly/1ffedf1334be60df5091399e489553e0 to your computer and use it in GitHub Desktop.
This implementation of main.swift for an iOS app dynamically switch the AppDelegate at runtime based on the presence of the TestingAppDelegate class, which is only available during unit testing.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import UIKit | |
let appDelegateClass: AnyClass = NSClassFromString("AppNameTests.TestingAppDelegate") ?? AppDelegate.self | |
UIApplicationMain(Process.argc, Process.unsafeArgv, nil, NSStringFromClass(appDelegateClass)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment