WebViewKit

0.4.0

WebViewKit is a Swift SDK that adds a WebView & SafariWebView to SwiftUI.
danielsaidi/WebViewKit

What's New

2024-03-14T22:30:49Z

This version adds support for visionOS.

WebViewKit Logo

Version Swift 5.9 Swift UI MIT License Twitter: @danielsaidi Mastodon: @danielsaidi@mastodon.social

About WebViewKit

WebViewKit is a Swift SDK that adds a WebView to SwiftUI.

The web view can be used to display web sites in your apps, for instance like this:

The WebView can load any url and be configured to fit your needs. There's also a SafariWebView for more basic needs.

Installation

WebViewKit can be installed with the Swift Package Manager:

https://github.com/danielsaidi/WebViewKit.git

Getting started

The library's main view is WebView, which can be used to display any URL:

import SwiftUI
import WebViewKit

struct MyView {

    var body: some View {
        WebView(urlString: "https://danielsaidi.com")
    }
}

The URL can point to any regular web site, but also to local web pages in your app bundle. There's also an iOS only SafariWebView, which has less configuration support and standard toolbars surrounding the web browser.

For more information, please see the getting started guide.

Documentation

The online documentation has more information, articles, code examples, etc.

Demo Application

The demo app lets you explore the library. To try it out, just open and run the Demo project.

Support my work

You can sponsor me on GitHub Sponsors or reach out for paid support, to help support my open-source projects.

Your support makes it possible for me to put more work into these projects and make them the best they can be.

Contact

Feel free to reach out if you have questions or if you want to contribute in any way:

License

WebViewKit is available under the MIT license. See the LICENSE file for more info.

Description

  • Swift Tools 5.9.0
View More Packages from this Author

Dependencies

  • None
Last updated: Thu May 30 2024 01:25:33 GMT-0900 (Hawaii-Aleutian Daylight Time)