{"id":26920347,"url":"https://github.com/wwt/swiftcurrent","last_synced_at":"2025-04-09T06:12:31.307Z","repository":{"id":37468711,"uuid":"205629955","full_name":"wwt/SwiftCurrent","owner":"wwt","description":"A library for managing complex workflows in Swift","archived":false,"fork":false,"pushed_at":"2023-01-29T02:35:16.000Z","size":13743,"stargazers_count":303,"open_issues_count":11,"forks_count":18,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-04-09T06:12:19.535Z","etag":null,"topics":["catalyst","cocoapods","ios","mac-catalyst","macos","navigation","swift","swift-package-manager","swiftui","tvos","uikit","watchos","workflow","workflows"],"latest_commit_sha":null,"homepage":"https://wwt.github.io/SwiftCurrent/","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/wwt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":".github/SECURITY.md","support":null}},"created_at":"2019-09-01T04:43:10.000Z","updated_at":"2025-02-28T15:24:40.000Z","dependencies_parsed_at":"2023-02-12T08:01:07.012Z","dependency_job_id":null,"html_url":"https://github.com/wwt/SwiftCurrent","commit_stats":null,"previous_names":["wwt/workflow"],"tags_count":153,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wwt%2FSwiftCurrent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wwt%2FSwiftCurrent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wwt%2FSwiftCurrent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wwt%2FSwiftCurrent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wwt","download_url":"https://codeload.github.com/wwt/SwiftCurrent/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247987285,"owners_count":21028895,"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":["catalyst","cocoapods","ios","mac-catalyst","macos","navigation","swift","swift-package-manager","swiftui","tvos","uikit","watchos","workflow","workflows"],"created_at":"2025-04-01T22:29:02.109Z","updated_at":"2025-04-09T06:12:31.292Z","avatar_url":"https://github.com/wwt.png","language":"Swift","readme":"![SwiftCurrent](https://user-images.githubusercontent.com/79471462/131564417-6f4976f4-270c-41b3-bbe1-428528e2cc2c.png)\n\n\u003c!-- Library Information --\u003e\n[![Supported Platforms](https://img.shields.io/badge/platform-iOS%20%7C%20macOS%20%7C%20watchOS%20%7C%20tvOS-lightgrey)](https://github.com/wwt/SwiftCurrent/security/policy)\n[![Swift Package Manager](https://img.shields.io/badge/Swift_Package_Manager-supported-brightgreen)](https://wwt.github.io/SwiftCurrent/installation.html#swift-package-manager)\n[![Pod Version](https://img.shields.io/cocoapods/v/SwiftCurrent.svg?style=popout)](https://wwt.github.io/SwiftCurrent/installation.html#cocoapods)\n[![License](https://img.shields.io/github/license/wwt/SwiftCurrent)](https://github.com/wwt/SwiftCurrent/blob/main/LICENSE)\n[![Build Status](https://github.com/wwt/SwiftCurrent/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/wwt/SwiftCurrent/actions?query=branch%3Amain)\n[![Code Coverage](https://codecov.io/gh/wwt/SwiftCurrent/branch/main/graph/badge.svg?token=04Q5KSHict)](https://codecov.io/gh/wwt/SwiftCurrent)\n\n# Welcome\n\nSwiftCurrent is a library that lets you easily manage journeys through your Swift application and comes with built-in support for UIKit and SwiftUI app-routing.\n\n## Why Should I Use SwiftCurrent?\n\nIn SwiftCurrent, workflows are a sequence of operations. Those operations usually display views in an application. The workflow describes the sequence of views and manages which view should come next. Your views are responsible for performing necessary tasks before proceeding forward in the workflow, like processing user input.\n\nArchitectural patterns and libraries that attempt to create a separation between views and workflows already exist. However, SwiftCurrent is different. We took a new design approach that focuses on:\n\n- **A Developer-Friendly API**. The library was built with developers in mind. It started with a group of developers talking about the code experience they desired. Then the library team took on whatever complexities were necessary to bring them that experience.\n- **Compile-Time Safety**. At compile-time, we tell you everything we can so you know things will work.\n- **Minimal Boilerplate**. We have hidden this as much as possible. We hate it as much as you do and are constantly working on cutting the cruft.\n\n### From There, We Created a Library\n\nThis library:\n\n- **Isolates Your Views**. Design your views so that they are unaware of the view that will come next.\n- **Easily Reorders Views**. Changing view order is as easy as ⌘+⌥+\\[ (moving the line up or down).\n- **Composes Workflows Together**. Create branching flows easily by joining workflows together.\n- **Creates Conditional Flows**. Make your flows robust and handle ever-changing designs. Need a screen to only to show up sometimes? Need a flow for person A and another for person B? We've got you covered.\n\n# Quick Start\n\nWhy show a quick start when we have an example app? Because it's so easy to get started, we can drop in two code snippets, and you're ready to go! This quick start uses Swift Package Manager and SwiftUI, but for other approaches, [see our installation instructions](https://wwt.github.io/SwiftCurrent/installation.html).\n\n```swift\n.package(url: \"https://github.com/wwt/SwiftCurrent.git\", .upToNextMajor(from: \"5.1.0\")),\n...\n.product(name: \"SwiftCurrent\", package: \"SwiftCurrent\"),\n.product(name: \"SwiftCurrent_SwiftUI\", package: \"SwiftCurrent\")\n```\n\nThen make your first FlowRepresentable view:\n\n```swift\nimport SwiftCurrent\nimport SwiftUI\nstruct OptionalView: View, FlowRepresentable {\n    weak var _workflowPointer: AnyFlowRepresentable?\n    let input: String\n    init(with args: String) { input = args }\n    var body: some View { Text(\"Only shows up if no input\") }\n    func shouldLoad() -\u003e Bool { input.isEmpty }\n}\nstruct ExampleView: View, PassthroughFlowRepresentable {\n    weak var _workflowPointer: AnyFlowRepresentable?\n    var body: some View { Text(\"This is ExampleView!\") }\n}\n```\n\nThen from your `ContentView` or whatever view (or app) you'd like to contain the workflow, add the following view to the body:\n\n```swift\nimport SwiftCurrent_SwiftUI\n// ...\nvar body: some View { \n    // ... other view code (if any)\n    WorkflowView(launchingWith: \"Skip optional screen\") {\n        WorkflowItem(OptionalView.self)\n        WorkflowItem(ExampleView.self)\n    }\n}\n```\n\nAnd just like that, you've got a workflow! You can now add more items to it or reorder the items that are there. To understand more of how this works, [check out our developer docs.](https://wwt.github.io/SwiftCurrent/How%20to%20use%20SwiftCurrent%20with%20SwiftUI.html)\n\n# Server Driven Workflows\nSwiftCurrent now supports server driven workflows! Check out our schema for details on defining workflows with JSON, YAML, or any other key/value-based data format. Then, simply have your `FlowRepresentable` types that you wish to decode conform to `WorkflowDecodable` and decode the workflow. For more information, [see our docs](https://wwt.github.io/SwiftCurrent/Server%20Driven%20Workflows.html).\n\n# Look at Our Example Apps\n\nWe have [example apps](https://github.com/wwt/SwiftCurrent/tree/main/ExampleApps) for both SwiftUI and UIKit that show SwiftCurrent in action. They've already been tested, so you can see what it's like to test SwiftCurrent code. To run it locally, start by cloning the repo, open `SwiftCurrent.xcworkspace` and then run the `SwiftUIExample` scheme or the `UIKitExample` scheme.\n\n# [Click Here to Learn More](https://wwt.github.io/SwiftCurrent/Creating%20Workflows.html)\n\nFor specific documentation check out:\n\n- [Why SwiftCurrent?](https://wwt.github.io/SwiftCurrent/why-this-library.html)\n- [Installation](https://wwt.github.io/SwiftCurrent/installation.html)\n- [Getting Started With SwiftUI](https://wwt.github.io/SwiftCurrent/getting-started-with-swiftui.html)\n- [Getting Started With Storyboards](https://wwt.github.io/SwiftCurrent/using-storyboards.html)\n- [Getting Started With Programmatic UIKit Views](https://wwt.github.io/SwiftCurrent/using-programmatic-views.html)\n- [Server Driven Workflows](https://wwt.github.io/SwiftCurrent/Server%20Driven%20Workflows.html)\n- [Developer Documentation](https://wwt.github.io/SwiftCurrent/index.html)\n- [Upgrade Path](https://github.com/wwt/SwiftCurrent/blob/main/.github/UPGRADE_PATH.md)\n- [Contributing to SwiftCurrent](https://github.com/wwt/SwiftCurrent/blob/main/.github/CONTRIBUTING.md)\n\n# Feedback\n\nIf you like what you've seen, consider [giving us a star](https://github.com/wwt/SwiftCurrent/stargazers)! If you don't, let us know [how we can improve](https://github.com/wwt/SwiftCurrent/discussions/new).\n\n\u003c!-- Social Media --\u003e\n[![Stars](https://img.shields.io/github/stars/wwt/SwiftCurrent?style=social)](https://github.com/wwt/SwiftCurrent/stargazers)\n\n# Special Thanks\n\nSwiftCurrent would not be nearly as amazing without all of the great work done by the authors of our test dependencies:\n\n- [CwlCatchException](https://github.com/mattgallagher/CwlCatchException)\n- [CwlPreconditionTesting](https://github.com/mattgallagher/CwlPreconditionTesting)\n- [ExceptionCatcher](https://github.com/sindresorhus/ExceptionCatcher)\n- [UIUTest](https://github.com/nallick/UIUTest)\n- [ViewInspector](https://github.com/nalexn/ViewInspector)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwwt%2Fswiftcurrent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwwt%2Fswiftcurrent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwwt%2Fswiftcurrent/lists"}