Skip to content

Instantly share code, notes, and snippets.

@regnerjr
Created January 7, 2019 18:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save regnerjr/fb38966a5bffec54084d508f5125ac1c to your computer and use it in GitHub Desktop.
Save regnerjr/fb38966a5bffec54084d508f5125ac1c to your computer and use it in GitHub Desktop.
For decoupled unit tests
import UIKit
private func delegateClassName() -> String? {
guard NSClassFromString("TestBundleName.TestingAppDelegate") == nil else {
// when running fast tests, use a nil AppDelegate
return nil
}
return NSStringFromClass(AppDelegate.self)
}
_ = UIApplicationMain(CommandLine.argc, CommandLine.unsafeArgv, nil, delegateClassName())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment