Swiftpack.co -  Package - jmisol/NSBootstrap
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
jmisol/NSBootstrap
Bootstrap an AppKit or SwiftUI App from a Swift Package.
.package(url: "https://github.com/jmisol/NSBootstrap.git", from: "0.2.0")

NSBootstrap

Bootstrap an AppKit or SwiftUI App from a Swift Package.

Usage

platforms: [
    .macOS(.v10_15),
],
dependencies: [
    .package(url: "https://github.com/jmisol/NSBootstrap.git", from: "0.2.0"),
],

SwiftUI Example

import SwiftUI
import NSBootstrap

struct ContentView: View {
    var body: some View {
        Text("Hello world!")
            .padding()
    }
}

NSBootstrap.swiftUI(ContentView()).run()

AppKit Example

import AppKit
import NSBootstrap

class ContentViewController : NSViewController {
    override func loadView() {
        self.view = NSView()
        self.view.widthAnchor.constraint(equalToConstant: 800).isActive = true
        self.view.heightAnchor.constraint(equalToConstant: 600).isActive = true
    }
}

NSBootstrap.appKit(ContentViewController()).run()

Notes

  • NSBootstrap is macOS only and not suitable for production use.
  • Some Xcode specific features like asset catalogs are not working when the target is build from the command line.

GitHub

link
Stars: 0
Last commit: 1 week ago

Release Notes

Initial Release
1 week ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco