WebViewKit is a SwiftUI library that adds a WebView
and a SafariWebView
that can present web sites in any app:
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.
WWDC 25 introduced a native WebView
component for iOS, macOS, and visionOS, as described in this blog post.
With this addition, this package is no longer needed. It will remain a public archive until iOS 27, then be removed.
WebViewKit can be installed with the Swift Package Manager:
https://github.com/danielsaidi/WebViewKit.git
You can become a sponsor to help me dedicate more time on my various open-source tools. Every contribution, no matter the size, makes a real difference in keeping these tools free and actively developed.
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 and try out the views.
Feel free to reach out if you have questions, or want to contribute in any way:
- Website: danielsaidi.com
- E-mail: daniel.saidi@gmail.com
- Bluesky: @danielsaidi@bsky.social
- Mastodon: @danielsaidi@mastodon.social
WebViewKit is available under the MIT license. See the LICENSE file for more info.