Skip to content

Commit

Permalink
Fixing wkWebView.takeSnapshot with Xcode 14 & 15
Browse files Browse the repository at this point in the history
This will fix this issue: #625
  • Loading branch information
teameh committed Dec 15, 2023
1 parent 4579af4 commit 51db042
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Sources/SnapshotTesting/Common/View.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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!)
}
Expand Down

0 comments on commit 51db042

Please sign in to comment.