Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save CollectiveHealth-gists/795e636f247558ce1c1846f0bad5f99b to your computer and use it in GitHub Desktop.
Save CollectiveHealth-gists/795e636f247558ce1c1846f0bad5f99b to your computer and use it in GitHub Desktop.
Testing iOS at Collective Health: Handling the launch argument
// This method is called from
// `application(didFinishLaunchingWithOptions:)`
private func handleLaunchArguments() {
var arguments = NSProcessInfo.processInfo().arguments
// The first argument is the path of the executable
arguments.removeFirst()
for argument in arguments {
switch argument {
case LaunchArguments.NoAnimations:
UIView.setAnimationsEnabled(false)
case LaunchArguments.ResetDefaults:
resetDefaults()
case LaunchArguments.GetCareSearchResult
setupSearchResults()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment