Created
November 1, 2017 14:02
-
-
Save soxjke/fd3f899f8d1a4c0b258292a9ca563725 to your computer and use it in GitHub Desktop.
Test-aware app launch
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
import UIKit | |
class AppDelegate: UIResponder, UIApplicationDelegate { | |
var window: UIWindow? | |
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { | |
let _ = AppStore.shared | |
let _ = LocationService.shared | |
let _ = WeatherService.shared | |
AppStore.shared.producer.logEvents().start() | |
return true | |
} | |
} |
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
import UIKit | |
var appDelegateClassName = | |
(nil != Bundle.allBundles.first { $0.bundlePath.contains(".xctest") }) ? | |
NSStringFromClass(TestAppDelegate.self) : | |
NSStringFromClass(AppDelegate.self) | |
let argv = UnsafeMutableRawPointer(CommandLine.unsafeArgv).bindMemory(to: UnsafeMutablePointer<Int8>.self, | |
capacity: Int(CommandLine.argc)) | |
UIApplicationMain(CommandLine.argc, argv, nil, appDelegateClassName) |
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
import UIKit | |
class TestAppDelegate: UIResponder, UIApplicationDelegate { | |
var window: UIWindow? | |
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { | |
return true | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment