Created
July 10, 2017 23:31
-
-
Save CollectiveHealth-gists/795e636f247558ce1c1846f0bad5f99b to your computer and use it in GitHub Desktop.
Testing iOS at Collective Health: Handling the launch argument
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
// 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