Skip to content

Support for WebView #46

Closed Answered by ekahannah
ekahannah asked this question in Q&A
Discussion options

You must be logged in to vote

Based on the SkipWeather app we can do this by doing a custom WebView class

// An example of wrapping a custom iOS UIView and Android View
// using SwiftUI.UIViewRepresentable
// and androidx.compose.ui.viewinterop.AndroidView
//
// This is a very minimal WebView that can be used as an embedded
// browser view. It has no address bar or history buttons. For a more 
// advanced web component, use http://source.skip.tools/skip-web
import SwiftUI
#if SKIP
import android.webkit.WebView
import android.webkit.WebViewClient
import androidx.compose.runtime.Composable
import androidx.compose.ui.viewinterop.AndroidView

struct WebView: View {
    let url: URL
    let enableJavaScript: Bool

    init…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ekahannah
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant