Go to file
2024-12-08 14:27:38 +01:00
Sources Bind url to WebView's uri property 2024-12-08 07:38:56 +01:00
Tests Bump Adwaita version 2024-10-18 19:22:54 +01:00
.gitignore Update .gitignore 2024-10-03 12:02:23 +01:00
LICENSE Update LICENSE 2024-10-14 19:46:56 +01:00
Package.swift Bump Adwaita version 2024-10-18 19:22:54 +01:00
README.md Update README.md 2024-10-18 15:34:51 +02:00

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

  1. Open your Swift package in GNOME Builder, or any other IDE.
  2. Open the Package.swift file.
  3. Into the Package initializer, under dependencies, 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

Other Thanks