Last active
September 19, 2021 19:22
-
-
Save dheerajn/b52e354dfbdc1653623dd25f6c39912d to your computer and use it in GitHub Desktop.
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
@main | |
struct SwiftUI_UITesting_MediumApp: App { | |
init() { | |
loadEnvironmentRelatedServices() | |
} | |
var body: some Scene { | |
WindowGroup { | |
ContentView() | |
} | |
} | |
private func loadEnvironmentRelatedServices() { | |
processLaunchArguments() | |
} | |
private func processLaunchArguments() { | |
var arguments = ProcessInfo.processInfo.arguments | |
arguments.removeFirst() // First argument is thec path | |
processCustomLaunchArguments(arguments) | |
} | |
private func processCustomLaunchArguments(_ arguments: [String]) { | |
arguments.forEach { | |
switch $0 { | |
case "NoAnimations": | |
UIView.setAnimationsEnabled(false) | |
default: | |
print("arguments should be handled") | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment