From 51db0428aa7130501980ffb25b9f8895576042bf Mon Sep 17 00:00:00 2001 From: Teameh <1330668+teameh@users.noreply.github.com> Date: Fri, 15 Dec 2023 19:47:02 +0100 Subject: [PATCH] Fixing wkWebView.takeSnapshot with Xcode 14 & 15 This will fix this issue: https://github.com/pointfreeco/swift-snapshot-testing/issues/625 --- Sources/SnapshotTesting/Common/View.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Sources/SnapshotTesting/Common/View.swift b/Sources/SnapshotTesting/Common/View.swift index 42be4d17a..7b9437b9f 100644 --- a/Sources/SnapshotTesting/Common/View.swift +++ b/Sources/SnapshotTesting/Common/View.swift @@ -612,7 +612,11 @@ extension View { callback(Image()) return } - wkWebView.takeSnapshot(with: nil) { image, _ in + let configuration = WKSnapshotConfiguration() + if #available(iOS 13, macOS 10.15, *) { + configuration.afterScreenUpdates = false + } + wkWebView.takeSnapshot(with: configuration) { image, _ in _ = delegate callback(image!) }