WebView adds support for embedding a webview into GNOME apps built using Adwaita For Swift.
Install webkitgtk6.0-devel
or similar (based on the package manager) as well as gtk4-devel
and libadwaita-devel
(or similar).
- Debian and derivatives
sudo apt install libadwaita-1-dev libwebkitgtk-6.0-dev libgtk-4-dev
- Fedora and derivatives
sudo dnf install libadwaita-devel webkitgtk6.0-devel gtk4-devel
- Open your Swift package in GNOME Builder, or any other IDE.
- Open the
Package.swift
file. - Into the
Package
initializer, underdependencies
, paste:
.package(url: "https://github.com/Zaphhh/AdwaitaWebViewSwift", branch: "main")
struct ContentView: View {
@State private var url: String = "https://github.com/Zaphhh/AdwaitaWebViewSwift"
var view: Body {
WebView(url: $url)
.setSize(width: 800, height: 600)
}
}
Take a look at the simple sample app. Check out the Adwaita packages.
- Adwaita licensed under the GPL-3.0 license
- The programming language Swift
- WebKitGTK for the widgets
- CodeEditor for the guide on embedding widgets