Last active
March 9, 2025 13:59
-
-
Save bcardarella/97191341e0bdf26f19ad7d01c8d3f8c3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
import LiveViewNative | |
@LiveElement | |
struct WebView<Root: RootRegistry>: View { | |
var body: some View { | |
WebView(url: URL(string: "http://example.net")).ignoresSafeArea() | |
} | |
} | |
extension Addons { | |
@Addon | |
struct WebView<Root: RootRegistry> { | |
enum TagName: String { | |
case webView = "WebView" | |
} | |
@ViewBuilder | |
public static func lookup(_ name: TagName, element: ElementNode) -> some View { | |
switch name { | |
case .webView: | |
WebView<Root>() | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment