WebViewKit is a SwiftUI library that has a custom WebView that can be used in iOS 14, macOS 11 & visionOS 1.
The WebView component 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.
Note
Since iOS 26, macOS 26, and visionOS 26 get a native WebView, this library is only kept for polyfill purposes.
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.
