{"id":24995621,"url":"https://github.com/peterfriese/swift-async-await-experiments","last_synced_at":"2025-04-12T04:11:16.660Z","repository":{"id":49113732,"uuid":"327635749","full_name":"peterfriese/Swift-Async-Await-Experiments","owner":"peterfriese","description":"Experiments with Swift's new async/await feature (SE 0296)","archived":false,"fork":false,"pushed_at":"2022-11-05T11:38:39.000Z","size":918,"stargazers_count":19,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-25T23:41:46.614Z","etag":null,"topics":["async","async-await","swift"],"latest_commit_sha":null,"homepage":"https://peterfriese.dev/async-await-in-swiftui/","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/peterfriese.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-07T14:29:12.000Z","updated_at":"2023-06-27T04:56:29.000Z","dependencies_parsed_at":"2023-01-21T02:15:58.630Z","dependency_job_id":null,"html_url":"https://github.com/peterfriese/Swift-Async-Await-Experiments","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterfriese%2FSwift-Async-Await-Experiments","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterfriese%2FSwift-Async-Await-Experiments/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterfriese%2FSwift-Async-Await-Experiments/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterfriese%2FSwift-Async-Await-Experiments/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peterfriese","download_url":"https://codeload.github.com/peterfriese/Swift-Async-Await-Experiments/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248514221,"owners_count":21116903,"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":["async","async-await","swift"],"created_at":"2025-02-04T15:39:19.463Z","updated_at":"2025-04-12T04:11:16.632Z","avatar_url":"https://github.com/peterfriese.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- PROJECT SHIELDS --\u003e\n[![Contributors][contributors-shield]][contributors-url]\n[![Forks][forks-shield]][forks-url]\n[![Stargazers][stars-shield]][stars-url]\n[![Issues][issues-shield]][issues-url]\n[![Discussions][discussions-shield]][discussions-url]\n[![Feature Requests][featurerequest-shield]][featurerequest-url]\n[![License][license-shield]][license-url\n\n\u003c!-- PROJECT LOGO --\u003e\n\u003cbr /\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/peterfriese/Swift-Async-Await-Experiments\"\u003e\n    \u003cimg src=\"images/swift-logo-512.png\" alt=\"Logo\" width=\"256\" height=\"256\"\u003e\n  \u003c/a\u003e\n\n  \u003ch1 align=\"center\"\u003eSwift async/await Experiments\u003c/h1\u003e\n\n  \u003cp align=\"center\"\u003e\n    Experiments with Swift's new async/await feature (SE 0296)\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/peterfriese/Swift-Async-Await-Experiments/discussions\"\u003eJoin the discussion\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/peterfriese/Swift-Async-Await-Experiments/issues\"\u003eReport Bug\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/peterfriese/Swift-Async-Await-Experiments/issues\"\u003eRequest Feature\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\n\n\n\u003c!-- ABOUT THE PROJECT --\u003e\n## About The Project\n\nExperiments with Swift's new async/await feature ([SE 0296](https://github.com/apple/swift-evolution/blob/main/proposals/0296-async-await.md))\n\n[Here's an article](https://peterfriese.dev/async-await-in-swiftui/) that shows you how to use this feature.\n\n## Requirements\nPrevious versions of the code in this repository made use of the experimental Swift compiler toolchain. Since WWDC 2021, support for async/await is now available in the default compiler toolchain.\n\n* Xcode 13 or later\n* ~~Swift Compiler Toolchain (Jan 04, 2021 or later)~~\n\n\u003c!-- GETTING STARTED --\u003e\n\u003c!-- ## Getting Started\n\nTo compile and run the code, make sure to follow these steps:\n\n1. Download the experimental Swift compiler toolchain from the [Snapshots/main](https://swift.org/download/#snapshots) section on the downloads page (I use the [May 18 2021 Swft 5.5 development snapshot](https://swift.org/builds/swift-5.5-branch/xcode/swift-5.5-DEVELOPMENT-SNAPSHOT-2021-05-18-a/swift-5.5-DEVELOPMENT-SNAPSHOT-2021-05-18-a-osx.pkg))\n2. Install the toolchain by double-clicking the package\n3. Activate the toolchain in Xcode (via _Settings \u003e Components \u003e Toolchains_)\n\nIn case you're stuck, Apple has detailed instructions [over here](https://developer.apple.com/library/archive/documentation/ToolsLanguages/Conceptual/Xcode_Overview/AlternativeToolchains.html).\n\nPlease note that (for a reason I don't yet understand), it's not possible to debug your code using the experimental toolchain. If you run your code and you get an error message saying LLDB couldn't attach to your process or similar, _turn off_ debugging:\n\n* Edit your launch scheme\n* Navigate into the _Run_ section\n* Make sure _Info \u003e Debug executable_ is unchecked\n\nUnfortunately, you can only select the toolchain on a global level, so keep in mind to select the built-in toolchain when you're done playing around with the code in this repository and want to go back working on your own app! --\u003e\n\n## Breaking changes\n\nAs this is still in development, there will be changes. I updated the code to reflect those changes, and wouldn't be surprised to see further breaking changes before a final release is cut. If you run into any issues, feel free to open an issue on this repo (or even better - send a PR if you've got time time to build a solution).\n\n### 2022-11-05\n* Updated the code to use `Task { }` instead of `async { }`\n\n### 2021-08-06 (WWDC 21)\n* Xcode 13 now contains Swift 5.5, we no longer need to download the experimental compiler toolchain\n* [According to the Swift team](https://twitter.com/AirspeedSwift/status/1401992834194952200), the correct way to launch an async task from with in SwiftUI is `async { }` (in beta 1) or `Task { }` (after beta 1).\n\n### 2021-05-25\n\nThe Swift Development team has been making a couple of breaking changes (after all, this is still pre-release software):\n* `@asyncHandler` has been removed from the language (see [PR #37415](https://github.com/apple/swift/pull/37415)). According to [this discussion](https://forums.swift.org/t/new-concurrency-api-not-available-in-latest-toolchain/47389/2), we can wrap asynchronous code in a call to `detach { }` as an alternative. As of yet, it is unclear what if there will be a replacement for `@asyncHandler`.\n* Since Swift can now be shipped with the OS, all new features in the Swift standard library will need to have an availability annotation. To be able to mark new APIs as available for unreleased versions of future versions of the OS, a special case of `9999` has been introduced. This also means that all code using those new APIs will need to use availability flags as well. For details, see [this discussion on the Swift forums](https://forums.swift.org/t/availability-and-the-standard-library/20932).\n\n\u003c!-- LICENSE --\u003e\n## License\n\nDistributed under the Apache 2 License. See `LICENSE` for more information.\n\n\n\u003c!-- MARKDOWN LINKS \u0026 IMAGES --\u003e\n\u003c!-- https://www.markdownguide.org/basic-syntax/#reference-style-links --\u003e\n[contributors-shield]: https://img.shields.io/github/contributors/peterfriese/Swift-Async-Await-Experiments.svg?style=flat-square\n[contributors-url]: https://github.com/peterfriese/Swift-Async-Await-Experiments/graphs/contributors\n[forks-shield]: https://img.shields.io/github/forks/peterfriese/Swift-Async-Await-Experiments.svg?style=flat-square\n[forks-url]: https://github.com/peterfriese/Swift-Async-Await-Experiments/network/members\n[stars-shield]: https://img.shields.io/github/stars/peterfriese/Swift-Async-Await-Experiments.svg?style=flat-square\n[stars-url]: https://github.com/peterfriese/Swift-Async-Await-Experiments/stargazers\n[issues-shield]: https://img.shields.io/github/issues/peterfriese/Swift-Async-Await-Experiments.svg?style=flat-square\n[issues-url]: https://github.com/peterfriese/Swift-Async-Await-Experiments/issues\n[license-shield]: https://img.shields.io/github/license/peterfriese/Swift-Async-Await-Experiments.svg?style=flat-square\n[license-url]: https://github.com/peterfriese/Swift-Async-Await-Experiments/blob/master/LICENSE.txt\n\n[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=flat-square\u0026logo=linkedin\u0026colorB=555\n[linkedin-url]: https://www.linkedin.com/in/peterfriese\n[product-screenshot]: images/screenshot.png\n\n[swift-shield]: https://img.shields.io/badge/swift-5.4_trunk-FA7343?logo=swift\u0026color=FA7343\u0026style=flat-square\n[swift-url]: https://swift.org\n\n[xcode-shield]: https://img.shields.io/badge/xcode-12.5_beta-1575F9?logo=Xcode\u0026style=flat-square\n[xcode-url]: https://developer.apple.com/xcode/\n\n[featurerequest-url]: https://github.com/peterfriese/Swift-Async-Await-Experiments/issues/new?assignees=\u0026labels=type%3A+feature+request\u0026template=feature_request.md\n[featurerequest-shield]: https://img.shields.io/github/issues/peterfriese/Swift-Async-Await-Experiments/feature-request?logo=github\u0026style=flat-square\n[discussions-url]: https://github.com/peterfriese/Swift-Async-Await-Experiments/discussions\n[discussions-shield]: https://img.shields.io/badge/discussions-brightgreen?logo=github\u0026style=flat-square","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterfriese%2Fswift-async-await-experiments","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeterfriese%2Fswift-async-await-experiments","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterfriese%2Fswift-async-await-experiments/lists"}