|
||
---|---|---|
Sources | ||
Tests | ||
.gitignore | ||
LICENSE | ||
Package.swift | ||
README.md |
WebView
WebView adds support for embedding a webview into GNOME apps built using Adwaita For Swift.
Table of Contents
Installation
Dependencies
Install webkitgtk6.0-devel
or similar (based on the package manager) as well as gtk4-devel
and libadwaita-devel
(or similar).
Examples
- 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
Swift Package
- 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://git.aparoksha.dev/Zaph/AdwaitaWebViewSwift", branch: "main")
Usage
struct ContentView: View {
@State private var url: String = "https://git.aparoksha.dev/Zaph/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.
Thanks
Dependencies
- Adwaita licensed under the GPL-3.0 license
Other Thanks
- The programming language Swift
- WebKitGTK for the widgets
- CodeEditor for the guide on embedding widgets