Awesome
<p align="center"> <img src ="Resources/Logo_GitHub.png" alt="WebViewKit Logo" title="WebViewKit" /> </p> <p align="center"> <img src="https://img.shields.io/github/v/release/danielsaidi/WebViewKit?color=%2300550&sort=semver" alt="Version" /> <img src="https://img.shields.io/badge/Swift-5.9-orange.svg" alt="Swift 5.9" title="Version" /> <img src="https://img.shields.io/badge/platform-SwiftUI-blue.svg" alt="Swift UI" title="Swift UI" /> <img src="https://img.shields.io/github/license/danielsaidi/WebViewKit" alt="MIT License" title="MIT License" /> <a href="https://twitter.com/danielsaidi"> <img src="https://img.shields.io/twitter/url?label=Twitter&style=social&url=https%3A%2F%2Ftwitter.com%2Fdanielsaidi" alt="Twitter: @danielsaidi" title="Twitter: @danielsaidi" /> </a> <a href="https://mastodon.social/@danielsaidi"> <img src="https://img.shields.io/mastodon/follow/000253346?label=mastodon&style=social" alt="Mastodon: @danielsaidi@mastodon.social" title="Mastodon: @danielsaidi@mastodon.social" /> </a> </p>About WebViewKit
WebViewKit is a Swift SDK that adds a WebView
and a SafariWebView
to SwiftUI
.
The web view can be used to display web sites in your apps, for instance like this:
<p align="center" style="border-radius: 80px; outline: 4px solid white; outline-offset: -4px"> <img src ="Resources/Demo.gif" width="300" /> </p>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:
- Website: danielsaidi.com
- Mastodon: @danielsaidi@mastodon.social
- Twitter: @danielsaidi
- E-mail: daniel.saidi@gmail.com
License
WebViewKit is available under the MIT license. See the LICENSE file for more info.