Enumeration
SnapshotSupport
public enum SnapshotSupport
A namespace for the methods supporting to generate snapshot from scenarios.
Methods
data(for:on:format:scale:keyWindow:handler:)
public static func data(for scenario: Scenario, on device: SnapshotDevice, format: ImageFormat, scale: CGFloat = UIScreen.main.scale, keyWindow: UIWindow? = nil, handler: @escaping (Data) -> Void)
Generates an image file data that snapshots the given scenario.
Parameters
Name | Type | Description |
---|---|---|
scenario | Scenario |
A scenario to be snapshot. |
device | SnapshotDevice |
A snapshot environment simulating device. |
format | ImageFormat |
An image file format of exported data. |
scale | CGFloat |
A rendering scale of the snapshot image. |
keyWindow | UIWindow? |
The key window of the application. |
handler | @escaping (Data) -> Void |
A closure that to handle generated data. |
image(for:on:scale:keyWindow:handler:)
public static func image(for scenario: Scenario, on device: SnapshotDevice, scale: CGFloat = UIScreen.main.scale, keyWindow: UIWindow? = nil, handler: @escaping (UIImage) -> Void)
Generates an UIImage
that snapshots the given scenario.
Parameters
Name | Type | Description |
---|---|---|
scenario | Scenario |
A scenario to be snapshot. |
device | SnapshotDevice |
A snapshot environment simulating device. |
scale | CGFloat |
A rendering scale of the snapshot image. |
keyWindow | UIWindow? |
The key window of the application. |
handler | @escaping (UIImage) -> Void |
A closure that to handle generated |