Skip to content

Commit

Permalink
Update README.md and remove unused variable from NavigationExample
Browse files Browse the repository at this point in the history
  • Loading branch information
stackotter committed Dec 11, 2023
1 parent ad16aa4 commit 52ef10a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
4 changes: 0 additions & 4 deletions Examples/Navigation/NavigationApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ enum HumanitiesSubject: Codable {

class NavigationAppState: Observable {
@Observed var path = NavigationPath()

var pathWrapper: Observed<NavigationPath> {
_path
}
}

@main
Expand Down
48 changes: 26 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
<img alt="GitHub" src="https://img.shields.io/github/license/stackotter/swift-cross-ui">
</p>

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

Expand Down Expand Up @@ -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 }
}
}
}
}
Expand All @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 52ef10a

Please sign in to comment.