Skip to content

Instantly share code, notes, and snippets.

@JARinteractive
Last active July 31, 2017 22:31
Show Gist options
  • Save JARinteractive/860a12253e8a26d94129 to your computer and use it in GitHub Desktop.
Save JARinteractive/860a12253e8a26d94129 to your computer and use it in GitHub Desktop.
simple main.swift to prevent running apps during unit testing
import UIKit
private func delegateClassName() -> String? {
guard NSClassFromString("XCTestCase") == nil else { return nil }
return NSStringFromClass(AppDelegate)
}
UIApplicationMain(Process.argc, Process.unsafeArgv, nil, delegateClassName())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment