{"id":13872040,"url":"https://github.com/stackotter/swift-cross-ui","last_synced_at":"2025-05-15T05:06:00.629Z","repository":{"id":42636432,"uuid":"446215300","full_name":"stackotter/swift-cross-ui","owner":"stackotter","description":"A cross-platform declarative UI framework, inspired by SwiftUI.","archived":false,"fork":false,"pushed_at":"2025-05-13T16:49:00.000Z","size":6916,"stargazers_count":849,"open_issues_count":26,"forks_count":46,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-05-13T16:49:14.096Z","etag":null,"topics":["appkit","declarative-ui","gtk","ios","linux","macos","open-source","swift","uikit","windows","winui3"],"latest_commit_sha":null,"homepage":"https://stackotter.github.io/swift-cross-ui/documentation/swiftcrossui/","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stackotter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["stackotter"]}},"created_at":"2022-01-09T22:15:02.000Z","updated_at":"2025-05-13T16:13:57.000Z","dependencies_parsed_at":"2024-06-17T02:31:50.091Z","dependency_job_id":"0965f694-36eb-4f57-a8a6-30f6212c6e58","html_url":"https://github.com/stackotter/swift-cross-ui","commit_stats":{"total_commits":262,"total_committers":9,"mean_commits":29.11111111111111,"dds":"0.18320610687022898","last_synced_commit":"c72824ca7b8eec17eb78ba0493853908aa61bffa"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackotter%2Fswift-cross-ui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackotter%2Fswift-cross-ui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackotter%2Fswift-cross-ui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackotter%2Fswift-cross-ui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackotter","download_url":"https://codeload.github.com/stackotter/swift-cross-ui/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254110364,"owners_count":22016391,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["appkit","declarative-ui","gtk","ios","linux","macos","open-source","swift","uikit","windows","winui3"],"created_at":"2024-08-05T23:00:32.709Z","updated_at":"2025-05-15T05:05:55.606Z","avatar_url":"https://github.com/stackotter.png","language":"Swift","readme":"\u003cp align=\"center\"\u003e\n    \u003cimg width=\"100%\" src=\"banner.png\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://github.com/stackotter/swift-cross-ui/workflows/Build%20macOS/badge.svg?branch=main\"\u003e\n    \u003cimg src=\"https://github.com/stackotter/swift-cross-ui/workflows/Build%20Linux/badge.svg?branch=main\"\u003e\n    \u003cimg src=\"https://github.com/stackotter/swift-cross-ui/workflows/Build%20Windows/badge.svg?branch=main\"\u003e\n    \u003cimg alt=\"GitHub\" src=\"https://img.shields.io/github/license/stackotter/swift-cross-ui\"\u003e\n\u003c/p\u003e\n\nA SwiftUI-like framework for creating cross-platform apps in Swift (5.10+).\n\nTo dive right in with SwiftCrossUI, check out [the SwiftCrossUI quick start guide](https://stackotter.github.io/swift-cross-ui/documentation/swiftcrossui/quick-start).\n\n\u003e [!NOTE]\n\u003e SwiftCrossUI does not attempt to replicate SwiftUI's API perfectly since that would be a constantly-moving target and SwiftUI has many entrenched Apple-centric concepts. That said, SwiftCrossUI's built-in views and scenes share much of their API surface with their SwiftUI cousins, and over time SwiftCrossUI will likely adopt many of SwiftUI's commonly-used APIs.\n\n## Overview\n\n- [Community](#community)\n- [Supporting SwiftCrossUI](#supporting-swiftcrossui)\n- [Documentation](#documentation)\n- [Basic example](#basic-example)\n- [Backends](#backends)\n\n## Community\n\nDiscussion about SwiftCrossUI happens in the [SwiftCrossUI Discord server](https://discord.gg/fw2trT48ny). [Join](https://discord.gg/fw2trT48ny) to discuss the library, get involved, or just be kept up-to-date on progress!\n\n## Supporting SwiftCrossUI\n\nIf you find SwiftCrossUI useful, please consider supporting me by [becoming a sponsor](https://github.com/sponsors/stackotter). I spend most of my spare time working on open-source projects, and each sponsorship helps me focus more time on making high quality libraries and tools for the community.\n\n## Documentation\n\nHere's the [documentation site](https://stackotter.github.io/swift-cross-ui/documentation/swiftcrossui). SwiftCrossUI is still a work-in-progress; proper documentation and tutorials are on the horizon. Documentation contributions are very welcome!\n\n## Basic example\n\nHere's a simple example app demonstrating how easy it is to get started with SwiftCrossUI. For a more detailed walkthrough, check out our [quick start guide](https://stackotter.github.io/swift-cross-ui/documentation/swiftcrossui/quick-start)\n\n```swift\nimport PackageDescription\n\nlet package = Package(\n    name: \"YourApp\",\n    dependencies: [\n        .package(url: \"https://github.com/stackotter/swift-cross-ui\", branch: \"main\")\n    ],\n    targets: [\n        .executableTarget(\n            name: \"YourApp\",\n            dependencies: [\n                .product(name: \"SwiftCrossUI\", package: \"swift-cross-ui\"),\n                .product(name: \"DefaultBackend\", package: \"swift-cross-ui\"),\n            ]\n        )\n    ]\n)\n```\nFigure 1: *Package.swift*\n\n```swift\nimport SwiftCrossUI\nimport DefaultBackend\n\n@main\nstruct CounterApp: App {\n    @State var count = 0\n\n    var body: some Scene {\n        WindowGroup(\"CounterApp\") {\n            HStack {\n                Button(\"-\") { count -= 1 }\n                Text(\"Count: \\(count)\")\n                Button(\"+\") { count += 1 }\n            }.padding()\n        }\n    }\n}\n```\n\nClone the SwiftCrossUI repository to test out this example, and many more;\n\n```sh\ngit clone https://github.com/stackotter/swift-cross-ui\ncd swift-cross-ui/Examples\nswift run CounterExample\n```\n\nThe documentation contains [a detailed list of all examples](https://stackotter.github.io/swift-cross-ui/documentation/swiftcrossui/examples)\n\n## Backends\n\nSwiftCrossUI has a variety of backends tailored to different operating systems. The beauty of SwiftCrossUI is that you can write your app once and have it look native everywhere. For this reason I recommend using [DefaultBackend](https://stackotter.github.io/swift-cross-ui/documentation/swiftcrossui/defaultbackend) unless you've got particular constraints.\n\n\u003e [!TIP]\n\u003e Click through each backend name for detailed system requirements and installation instructions.\n\n- [DefaultBackend](https://stackotter.github.io/swift-cross-ui/documentation/swiftcrossui/defaultbackend): Adapts to your target operating system. On macOS it uses [AppKitBackend](https://stackotter.github.io/swift-cross-ui/documentation/swiftcrossui/appkitbackend), on Windows it uses [WinUIBackend](https://stackotter.github.io/swift-cross-ui/documentation/swiftcrossui/winuibackend), on Linux it uses [GtkBackend](https://stackotter.github.io/swift-cross-ui/documentation/swiftcrossui/gtkbackend), and on iOS and tvOS it uses [UIKitBackend](https://stackotter.github.io/swift-cross-ui/documentation/swiftcrossui/uikitbackend).\n- [AppKitBackend](https://stackotter.github.io/swift-cross-ui/documentation/swiftcrossui/appkitbackend): The native macOS backend. Supports all SwiftCrossUI features.\n- [UIKitBackend](https://stackotter.github.io/swift-cross-ui/documentation/swiftcrossui/uikitbackend): The native iOS \u0026 tvOS backend. Supports most SwiftCrossUI features.\n- [WinUIBackend](https://stackotter.github.io/swift-cross-ui/documentation/swiftcrossui/winuibackend): The native Windows backend. Supports most SwiftCrossUI features.\n- [GtkBackend](https://stackotter.github.io/swift-cross-ui/documentation/swiftcrossui/gtkbackend): Works on Linux, macOS, and Windows. Requires gtk 4 to be installed. Supports most SwiftCrossUI features.\n- [Gtk3Backend](https://stackotter.github.io/swift-cross-ui/documentation/swiftcrossui/gtk3backend): Exists to target older Linux distributions. Requires gtk 3 to be installed. Supports most SwiftCrossUI features. Quite buggy on macOS due to underlying Gtk 3 bugs.\n\n\u003e [!TIP]\n\u003e If you're using DefaultBackend, you can override the underlying backend during compilation by setting the `SCUI_DEFAULT_BACKEND` environment variable to the name of the desired backend. This is useful when you e.g. want to test the Gtk version of your app while using a Mac. Note that this only works for built-in backends and still requires the chosen backend to be compatible with your machine.\n","funding_links":["https://github.com/sponsors/stackotter"],"categories":["Swift"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackotter%2Fswift-cross-ui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackotter%2Fswift-cross-ui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackotter%2Fswift-cross-ui/lists"}