Skip to content

Instantly share code, notes, and snippets.

@candostdagdeviren
Created December 3, 2018 12:39
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 candostdagdeviren/93fff7b82b2a1ae23ebc4ed183088b9d to your computer and use it in GitHub Desktop.
Save candostdagdeviren/93fff7b82b2a1ae23ebc4ed183088b9d to your computer and use it in GitHub Desktop.
Swift Post Testability Example Code
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
let isUnitTesting = ProcessInfo.processInfo.environment["IS_UNIT_TESTING"] == "1"
if isUnitTesting == false {
// Do UI-related setup, which can be skipped when testing
}
return true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment