Contents

astzweig/swiftui-frameless-window

🚥 Frameless window Scene for SwiftUI. Just a bare window.

Usage

Create a window without the title bar and only the close default button.

import SwiftUI
import FramelessWindow

@main
struct YourApp: App {
    var body: some Scene {
        FramelessWindow("Window Title", id: "window-id") {
            ContentView()
        }
    }
}

Documentation

The library has enriched symbol documentation for [DocC].

[DocC]: https://www.swift.org/documentation/docc/documenting-a-swift-framework-or-package

Testing `FramelessWindow`

FramelessWindow includes an executable target that launches a SwiftUI app to test FramelessWindow. Either execute it with

$ swift run

or select the TestApp under Product > Scheme in Xcode.

Adding `FramelessWindow` as a Dependency

To use the FramelessWindow library in a SwiftUI project, add it to the dependencies for your package:

let package = Package(
    // name, platforms, products, etc.
    dependencies: [
        // other dependencies
        .package(url: "https://github.com/astzweig/swiftui-frameless-window", from: "1.0.0"),
    ],
    targets: [
        .executableTarget(name: "<command-line-tool>", dependencies: [
            // other dependencies
            .product(name: "FramelessWindow", package: "swiftui-frameless-window"),
        ]),
        // other targets
    ]
)

Supported Versions

The minimum Swift version supported by swiftui-frameless-window releases are detailed below:

swiftui-frameless-window | Minimum Swift Version ---------------------------|---------------------- 0.0.1 ... | 5.7 2.0.0 ... | 5.10

Package Metadata

Repository: astzweig/swiftui-frameless-window

Stars: 4

Forks: 0

Open issues: 0

Default branch: main

Primary language: swift

License: EUPL-1.2

Topics: frameless-window, macos-app, scene, swiftui

README: README.md