Instance Method

takeSnapshot(with:completionHandler:)

Takes a snapshot of the view's visible viewport.

Declaration

iOS, UIKit for Mac
func takeSnapshot(with snapshotConfiguration: WKSnapshotConfiguration?, completionHandler: @escaping (UIImage?, Error?) -> Void)
macOS
func takeSnapshot(with snapshotConfiguration: WKSnapshotConfiguration?, completionHandler: @escaping (NSImage?, Error?) -> Void)