WebViewKit is a SwiftUI SDK that adds a WebView
and a SafariWebView
to SwiftUI
, that can be used to embed web content and present web sites in your apps:
The WebView
component supports iOS, macOS, & visionOS, and can be configured to fit your needs, while the iOS exclusive SafariWebView
can be used for more basic needs and a more browser-like experience.
WebViewKit can be installed with the Swift Package Manager:
https://github.com/danielsaidi/WebViewKit.git
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")
}
}
See the online getting started guide for more information.
The online documentation has more information, articles, code examples, etc.
The Demo
folder has an app that lets you explore the library.
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.
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
WebViewKit is available under the MIT license. See the LICENSE file for more info.