LaunchEnvironmentManager
public final class LaunchEnvironmentManager
Handles launch environments passed by the UI test runner. Launch environments passed by the AutoMate are working.
LaunchEnvironmentManager should be initialized in the application delegate
in method application(_:didFinishLaunchingWithOptions:).
Example:
let launchManager = aunchEnvironmentManager()
launchManager.add(handler: defaultEventKitHander, for: .events)
launchManager.add(handler: defaultEventKitHander, for: .reminders)
launchManager.add(handler: defaultContactsHander, for: .contacts)
launchManager.add(handler: defaultIsInUITestHandler, for: .isInUITest)
launchManager.add(handler: AnimationHandler(), for: .animation)
launchManager.setup()
-
Initialize object with launch environments. By default
ProcessInfo.processInfo.environmentis used.Declaration
Swift
public init(environment: [String: String] = ProcessInfo.processInfo.environment)Parameters
environmentlaunch environment passed to the application.
-
Process launch environemtns and pass them to correct handlers.
Declaration
Swift
public func setup() -
Add new
Handlerobject which process data from launch environments with givenkey.Declaration
Swift
public func add(handler: Handler, for key: LaunchOptionKey)Parameters
handlerObject implementing
Handlerprotocol.keyKey for which
handlerwill be executed. -
Add new
Handlerobject which process data from launch environments with givenkey.Declaration
Swift
public func add(handler: Handler, for key: AutoMateLaunchOptionKey)Parameters
handlerObject implementing
Handlerprotocol.keyKey for which
handlerwill be executed.
LaunchEnvironmentManager Class Reference