Created
December 3, 2017 18:17
-
-
Save azamsharp/d2dfe23384231c5683a27435cef446fb to your computer and use it in GitHub Desktop.
Reset Test Cleanup
This file contains hidden or 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
@UIApplicationMain | |
class AppDelegate: UIResponder, UIApplicationDelegate { | |
var window: UIWindow? | |
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { | |
resetUserDefaults() | |
return true | |
} | |
private func resetUserDefaults() { | |
if ProcessInfo.processInfo.arguments.contains("UI-Testing") { | |
UserDefaults.standard.removePersistentDomain(forName: Bundle.main.bundleIdentifier!) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment