diff --git a/Examples/Navigation/NavigationApp.swift b/Examples/Navigation/NavigationApp.swift index 40e46082..e1674bf4 100644 --- a/Examples/Navigation/NavigationApp.swift +++ b/Examples/Navigation/NavigationApp.swift @@ -19,10 +19,6 @@ enum HumanitiesSubject: Codable { class NavigationAppState: Observable { @Observed var path = NavigationPath() - - var pathWrapper: Observed { - _path - } } @main diff --git a/README.md b/README.md index 6e453463..17315b3c 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,11 @@ GitHub

-A SwiftUI-like framework for creating cross-platform apps in Swift (using Gtk 4 as the backend). +A SwiftUI-like framework for creating cross-platform apps in Swift. This package is still quite a work-in-progress so don't expect it to be very useful or stable yet. -**NOTE**: SwiftCrossUI does not attempt to replicate SwiftUI's API because SwiftCrossUI is intended to be simpler than SwiftUI. However, many concepts from SwiftUI should still be transferrable. +**NOTE**: SwiftCrossUI does not attempt to replicate SwiftUI's API perfectly because SwiftCrossUI is intended to be simpler than SwiftUI. However, many concepts from SwiftUI should still be transferrable. ## Community @@ -54,16 +54,16 @@ struct CounterApp: App { typealias Backend = GtkBackend let identifier = "dev.stackotter.CounterApp" - + let state = CounterState() - - let windowProperties = WindowProperties(title: "CounterApp") - + var body: some ViewContent { - HStack { - Button("-") { state.count -= 1 } - Text("Count: \(state.count)") - Button("+") { state.count += 1 } + WindowGroup("CounterApp") { + HStack { + Button("-") { state.count -= 1 } + Text("Count: \(state.count)") + Button("+") { state.count += 1 } + } } } } @@ -82,10 +82,14 @@ To see all of the examples, run these commands: ```sh swift run CounterExample swift run RandomNumberGeneratorExample -swift run WindowPropertiesExample +swift run WindowingExample swift run GreetingGeneratorExample swift run FileViewerExample swift run NavigationExample +swift run SpitExample +swift run StressTestExample +swift run SpreadsheetExample +swift run ControlsExample ``` All examples use the `GtkBackend` but can easily be updated to test out other backends. @@ -101,17 +105,6 @@ Here's the [documentation site](https://stackotter.github.io/swift-cross-ui/docu 3. clang (only required on Linux for GtkBackend) 4. Qt5 (only required for QtBackend) -### Installing Qt5 - -```sh -# On macOS -brew install qt@5 -brew link qt@5 - -# Linux with apt -sudo apt install qtcreator qtbase5-dev qt5-qmake cmake -``` - ### macOS: Installing Gtk 4 Install Gtk 4 using HomeBrew or the package manager of your choice. @@ -195,6 +188,17 @@ If you run into issues (potentially related to `libsass`), try installing global To identify which of them are required, you can use [the Dependencies tool](https://github.com/lucasg/Dependencies) to inspect the compiled executable, and copy all vcpkg-installed DLLs along with the executable for distribution. +### Installing Qt5 + +```sh +# On macOS +brew install qt@5 +brew link qt@5 + +# Linux with apt +sudo apt install qtcreator qtbase5-dev qt5-qmake cmake +``` + ## Usage Just add SwiftCrossUI as a dependency in your `Package.swift`. See below for an example package manifest: