Skip to content

Commit 8e68404

Browse files
authored
Fixing wkWebView.takeSnapshot with Xcode 14 & 15 (#692)
This will fix this issue: #625
1 parent 9bfa0aa commit 8e68404

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Sources/SnapshotTesting/Common/View.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,11 @@
868868
callback(Image())
869869
return
870870
}
871-
wkWebView.takeSnapshot(with: nil) { image, _ in
871+
let configuration = WKSnapshotConfiguration()
872+
if #available(iOS 13, macOS 10.15, *) {
873+
configuration.afterScreenUpdates = false
874+
}
875+
wkWebView.takeSnapshot(with: configuration) { image, _ in
872876
callback(image!)
873877
}
874878
}

0 commit comments

Comments
 (0)