Skip to content

Commit

Permalink
ensure that ui update is applied
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelhenry committed Jul 8, 2024
1 parent 5d45035 commit e2de1f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Demo/DemoTests/Helpers/Snapshotting+WindowImage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ extension Snapshotting where Value: UIViewController, Format == UIImage {
guard let window = UIApplication.shared.connectedScenes.compactMap({ $0 as? UIWindowScene }).first?.windows.first else { return }
window.rootViewController = vc
action()
DispatchQueue.main.async {
DispatchQueue.main.sync {
let image = UIGraphicsImageRenderer(bounds: window.bounds).image { _ in
window.drawHierarchy(in: window.bounds, afterScreenUpdates: true)
}
Expand Down

0 comments on commit e2de1f8

Please sign in to comment.