From 6f44840640982969d653a025a91e4cb1ca83a56c Mon Sep 17 00:00:00 2001 From: Teameh <1330668+teameh@users.noreply.github.com> Date: Thu, 15 Sep 2022 15:43:54 +0200 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 775072224..111f6af29 100644 --- a/Sources/SnapshotTesting/Common/View.swift +++ b/Sources/SnapshotTesting/Common/View.swift @@ -868,7 +868,11 @@ 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 callback(image!) } }