From 6cc5532aef4caa8fddd49062e2dac5c718e9e5c2 Mon Sep 17 00:00:00 2001 From: Ben Chatelain Date: Sun, 6 Feb 2022 13:23:46 -0700 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20KeyPath=20subscripting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/WebView/WebViewStore.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Sources/WebView/WebViewStore.swift b/Sources/WebView/WebViewStore.swift index 97c26e7..72b3ff7 100644 --- a/Sources/WebView/WebViewStore.swift +++ b/Sources/WebView/WebViewStore.swift @@ -27,6 +27,11 @@ public class WebViewStore: ObservableObject { setupObservers() } + /// Enables KeyPath access to wrapped WKWebView properties. + public subscript(keyPath: KeyPath) -> T { + webView[keyPath: keyPath] + } + deinit { observers.forEach { // Not even sure if this is required?