{"id":34533856,"url":"https://github.com/vsanthanam/viewscope","last_synced_at":"2026-05-27T01:00:48.012Z","repository":{"id":329319289,"uuid":"1119091321","full_name":"vsanthanam/ViewScope","owner":"vsanthanam","description":"Better async contexts in SwiftUI","archived":false,"fork":false,"pushed_at":"2025-12-24T05:07:04.000Z","size":22,"stargazers_count":15,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-24T10:40:30.510Z","etag":null,"topics":["async","await","concurrency","scope","swiftui","task"],"latest_commit_sha":null,"homepage":"http://www.viewsco.pe/","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/vsanthanam.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,"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}},"created_at":"2025-12-18T18:19:14.000Z","updated_at":"2026-02-04T10:40:40.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/vsanthanam/ViewScope","commit_stats":null,"previous_names":["vsanthanam/viewscope"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/vsanthanam/ViewScope","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsanthanam%2FViewScope","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsanthanam%2FViewScope/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsanthanam%2FViewScope/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsanthanam%2FViewScope/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vsanthanam","download_url":"https://codeload.github.com/vsanthanam/ViewScope/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsanthanam%2FViewScope/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33545458,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"ssl_error","status_checked_at":"2026-05-26T15:22:15.568Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["async","await","concurrency","scope","swiftui","task"],"created_at":"2025-12-24T05:55:15.760Z","updated_at":"2026-05-27T01:00:47.996Z","avatar_url":"https://github.com/vsanthanam.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ViewScope\n\n[![MIT License](https://img.shields.io/github/license/vsanthanam/ViewScope)](https://github.com/vsanthanam/ViewScope/blob/main/LICENSE)\n[![GitHub Release](https://img.shields.io/github/v/release/vsanthanam/ViewScope?include_prereleases)](https://github.com/vsanthanam/ViewScope/releases)\n[![Build Status](https://img.shields.io/github/check-runs/vsanthanam/ViewScope/main)](https://github.com/vsanthanam/ViewScope/actions)\n[![Swift Version](https://img.shields.io/badge/swift-6.2-critical)](https://swift.org)\n[![Documentation](https://img.shields.io/badge/Documentation-GitHub-8A2BE2)](https://www.viewsco.pe/docs/documentation/viewscope)\n\n## Overview\n\nViewScope is a library that lets you create structured, SwiftUI-friendly async contexts for imperative asynchronous work, such as making a network request when a user taps on a button. It allows you to scope this work to a specific node in the SwiftUI view hiearchy and prevents you from needing to rely on unstructured concurrency to manage task cancellation.\n\nFor example:\n\n```swift\nimport ViewScope\n\nstruct MyScreen: View {\n\n    @ViewScope myScope\n    \n    var body: some View {\n        VStack {\n            Text(\"This screen can produce async side effects that need to be cancelled if it ever disappears, for example if the user interacts with a deeplink or dismisses a sheet presentation with a swipe\")\n            Button(\"Make Network Request\") {\n                myScope.task {\n                    await makeNetworkRequest()\n                }\n            }\n        }\n        .whileVisible($myScope)\n    }\n\n    func makeNetworkRequest() async {\n        // Await things here\n    }\n\n}\n```\n\n## Installation\n\nViewScope currently distributed exclusively through the [Swift Package Manager](https://www.swift.org/package-manager/). \n\nTo add ViewScope as a dependency to an existing Swift package, add the following line of code to the `dependencies` parameter of your `Package.swift` file:\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/vsanthanam/ViewScope.git\", from: \"1.0.0\")\n]\n```\n\nTo add ViewScope as a dependency to an Xcode Project: \n\n- Choose `File` → `Add Packages...`\n- Enter package URL `https://github.com/vsanthanam/ViewScope.git` and select your release and of choice.\n\nOther distribution mechanisms like CocoaPods or Carthage may be added in the future.\n\n## Usage \u0026 Documentation\n\nViewScope's documentation is built with [DocC](https://developer.apple.com/documentation/docc) and included in the repository as a DocC archive. The latest version is hosted on [GitHub Pages](https://pages.github.com) and is available [here](https://www.viewsco.pe/docs/documentation/viewscope)).\n\nAdditional installation instructions are available on the [Swift Package Index](https://swiftpackageindex.com/vsanthanam/ViewScope)\n\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fvsanthanam%2FViewScope%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/vsanthanam/ViewScope)\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fvsanthanam%2FViewScope%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/vsanthanam/ViewScope)\n\nExplore [the documentation](https://www.viewsco.pe/docs/documentation/viewscope) for more details.\n\n## License\n\n**ViewScope** is available under the [MIT license](https://en.wikipedia.org/wiki/MIT_License). See the [LICENSE](https://github.com/vsanthanam/ViewScope/blob/main/LICENSE) file for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvsanthanam%2Fviewscope","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvsanthanam%2Fviewscope","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvsanthanam%2Fviewscope/lists"}