// AppDelegate.swift
import Lunch
let creator = Creator()
let rootViewController: UIViewController
#if DEBUG
if let viewController: UIViewController = Launcher(with: creator).launch() {
rootViewController = viewController
} else {
rootViewController = creator.lunchViewController()
}
#else
rootViewController = creator.lunchViewController()
#endif
window?.rootViewController = rootViewController
NOTE: If you want change rootViewController after Run Xcode, set LAUNCH_VIEW_CONTROLLER key and viewController name to value in Environment Variables of your scheme.
In UI Test target.
1 Add component and adopt protocol PageObjectsRepresentable.
Lunch
Lunch is helper of UI Test with Swift.
Requirements
Installation
Carthage
github "fromkk/Lunch"
to yourCartfile
.carthage update
Lunch.framework
inCarthage/Build
LunchTest.framework
inCarthage/Build
Usage
In App target adopt protocol
Creatable
.In UI Test target.
1 Add component and adopt protocol
PageObjectsRepresentable
.2 Add your tests and adopt protocol
ViewControllerTestable