{"id":49204004,"url":"https://github.com/moreswift/swift-cross-ui","last_synced_at":"2026-05-14T07:05:03.685Z","repository":{"id":42636432,"uuid":"446215300","full_name":"moreSwift/swift-cross-ui","owner":"moreSwift","description":"A cross-platform declarative UI framework, inspired by SwiftUI.","archived":false,"fork":false,"pushed_at":"2026-04-20T06:46:08.000Z","size":2805,"stargazers_count":1519,"open_issues_count":177,"forks_count":76,"subscribers_count":18,"default_branch":"main","last_synced_at":"2026-04-22T22:05:34.839Z","etag":null,"topics":["appkit","declarative-ui","gtk","ios","linux","macos","open-source","swift","uikit","windows","winui3"],"latest_commit_sha":null,"homepage":"https://swiftcrossui.dev","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/moreSwift.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["stackotter"]}},"created_at":"2022-01-09T22:15:02.000Z","updated_at":"2026-04-21T12:00:17.000Z","dependencies_parsed_at":"2024-06-17T02:31:50.091Z","dependency_job_id":"2f6e1e2f-1e84-4444-b994-c3ee428f8876","html_url":"https://github.com/moreSwift/swift-cross-ui","commit_stats":{"total_commits":262,"total_committers":9,"mean_commits":29.11111111111111,"dds":"0.18320610687022898","last_synced_commit":"c72824ca7b8eec17eb78ba0493853908aa61bffa"},"previous_names":["moreswift/swift-cross-ui","stackotter/swift-cross-ui"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/moreSwift/swift-cross-ui","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moreSwift%2Fswift-cross-ui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moreSwift%2Fswift-cross-ui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moreSwift%2Fswift-cross-ui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moreSwift%2Fswift-cross-ui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moreSwift","download_url":"https://codeload.github.com/moreSwift/swift-cross-ui/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moreSwift%2Fswift-cross-ui/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32189660,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-23T15:28:30.493Z","status":"ssl_error","status_checked_at":"2026-04-23T15:28:29.972Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2026-04-23T17:00:51.637Z","updated_at":"2026-04-23T17:00:55.396Z","avatar_url":"https://github.com/moreSwift.png","language":"Swift","funding_links":["https://github.com/sponsors/stackotter"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg width=\"100%\" src=\"banner.png\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/moreSwift/swift-cross-ui/actions/workflows/build-test-and-docs.yml\"\u003e\u003cimg alt=\"Workflow status\" src=\"https://github.com/moreSwift/swift-cross-ui/actions/workflows/build-test-and-docs.yml/badge.svg?event=push\"\u003e\u003c/a\u003e\n    \u003cimg alt=\"License\" src=\"https://img.shields.io/github/license/moreSwift/swift-cross-ui\"\u003e\n    \u003ca href=\"https://moreswift.dev/discord\"\u003e\u003cimg src=\"https://img.shields.io/discord/1123965445687484466?color=6A7EC2\u0026label=discord\u0026logo=discord\u0026logoColor=ffffff\"\u003e\u003c/a\u003e \n\u003c/p\u003e\n\nA SwiftUI-like framework for creating cross-platform apps in Swift (5.10+).\n\nTo get started with SwiftCrossUI, check out [the quick start guide](https://docs.swiftcrossui.dev/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 [moreSwift Discord server](https://moreswift.dev/discord). [Join](https://moreswift.dev/discord) 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 its development 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://docs.swiftcrossui.dev/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://docs.swiftcrossui.dev/documentation/swiftcrossui/quick-start)\n\n```swift\nimport PackageDescription\n\nlet package = Package(\n    name: \"YourApp\",\n    dependencies: [\n        .package(\n            url: \"https://github.com/moreSwift/swift-cross-ui\",\n            .upToNextMinor(from: \"0.2.0\")\n        ),\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 YourApp: App {\n    @State var count = 0\n\n    var body: some Scene {\n        WindowGroup(\"YourApp\") {\n            HStack {\n                Button(\"-\") { count -= 1 }\n                Text(\"Count: \\(count)\")\n                Button(\"+\") { count += 1 }\n            }.padding()\n        }\n    }\n}\n```\nFigure 2: *Sources/YourApp/YourApp.swift*\n\n## More examples\n\nThe SwiftCrossUI repository contains the above example and many more. The documentation hosts [a detailed list of all examples](https://docs.swiftcrossui.dev/documentation/swiftcrossui/examples).\n\nRunning the examples requires [Swift Bundler](https://github.com/moreSwift/swift-bundler), which provides consistent behavior across platforms and enables running on iOS/tvOS devices and simulators.\n\nTo install Swift Bundler, follow [its official installation instructions](https://github.com/moreSwift/swift-bundler?tab=readme-ov-file#installation-).\n\n```sh\ngit clone https://github.com/moreSwift/swift-cross-ui\ncd swift-cross-ui/Examples\n\n# Run on host machine\nswift-bundler run CounterExample\n# Run on a connected device with \"iPhone\" in its name (macOS only)\nswift-bundler run CounterExample --device iPhone\n# Run on a simulator with \"iPhone 16\" in its name (macOS only)\nswift-bundler run CounterExample --simulator \"iPhone 16\"\n```\n\nThese examples may also be run using SwiftPM. However, resources may not be loaded as expected, and features such as deep linking may not work. You also won't be able to run the examples on iOS or tvOS using this method.\n\n```sh\n# Non-recommended method\nswift run CounterExample\n```\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://docs.swiftcrossui.dev/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://docs.swiftcrossui.dev/documentation/swiftcrossui/defaultbackend): Adapts to your target operating system. On macOS it uses [AppKitBackend](https://docs.swiftcrossui.dev/documentation/swiftcrossui/appkitbackend), on Windows it uses [WinUIBackend](https://docs.swiftcrossui.dev/documentation/swiftcrossui/winuibackend), on Linux it uses [GtkBackend](https://docs.swiftcrossui.dev/documentation/swiftcrossui/gtkbackend), and on iOS and tvOS it uses [UIKitBackend](https://docs.swiftcrossui.dev/documentation/swiftcrossui/uikitbackend).\n- [AppKitBackend](https://docs.swiftcrossui.dev/documentation/swiftcrossui/appkitbackend): The native macOS backend. Supports all SwiftCrossUI features.\n- [UIKitBackend](https://docs.swiftcrossui.dev/documentation/swiftcrossui/uikitbackend): The native iOS \u0026 tvOS backend. Supports most SwiftCrossUI features.\n- [WinUIBackend](https://docs.swiftcrossui.dev/documentation/swiftcrossui/winuibackend): The native Windows backend. Supports most SwiftCrossUI features.\n- [GtkBackend](https://docs.swiftcrossui.dev/documentation/swiftcrossui/gtkbackend): Works on Linux, macOS, and Windows. Requires gtk 4 to be installed. Supports most SwiftCrossUI features.\n- [Gtk3Backend](https://docs.swiftcrossui.dev/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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoreswift%2Fswift-cross-ui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoreswift%2Fswift-cross-ui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoreswift%2Fswift-cross-ui/lists"}