ProductPromotion
Logo

Swift

made by https://0x3d.site

GitHub - wwt/SwiftCurrent: A library for managing complex workflows in Swift
A library for managing complex workflows in Swift. Contribute to wwt/SwiftCurrent development by creating an account on GitHub.
Visit Site

GitHub - wwt/SwiftCurrent: A library for managing complex workflows in Swift

GitHub - wwt/SwiftCurrent: A library for managing complex workflows in Swift

SwiftCurrent

Supported Platforms Swift Package Manager Pod Version License Build Status Code Coverage

Welcome

SwiftCurrent 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.

Why Should I Use SwiftCurrent?

In 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.

Architectural 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:

  • 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.
  • Compile-Time Safety. At compile-time, we tell you everything we can so you know things will work.
  • 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.

From There, We Created a Library

This library:

  • Isolates Your Views. Design your views so that they are unaware of the view that will come next.
  • Easily Reorders Views. Changing view order is as easy as โŒ˜+โŒฅ+[ (moving the line up or down).
  • Composes Workflows Together. Create branching flows easily by joining workflows together.
  • 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.

Quick Start

Why 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.

.package(url: "https://github.com/wwt/SwiftCurrent.git", .upToNextMajor(from: "5.1.0")),
...
.product(name: "SwiftCurrent", package: "SwiftCurrent"),
.product(name: "SwiftCurrent_SwiftUI", package: "SwiftCurrent")

Then make your first FlowRepresentable view:

import SwiftCurrent
import SwiftUI
struct OptionalView: View, FlowRepresentable {
    weak var _workflowPointer: AnyFlowRepresentable?
    let input: String
    init(with args: String) { input = args }
    var body: some View { Text("Only shows up if no input") }
    func shouldLoad() -> Bool { input.isEmpty }
}
struct ExampleView: View, PassthroughFlowRepresentable {
    weak var _workflowPointer: AnyFlowRepresentable?
    var body: some View { Text("This is ExampleView!") }
}

Then from your ContentView or whatever view (or app) you'd like to contain the workflow, add the following view to the body:

import SwiftCurrent_SwiftUI
// ...
var body: some View { 
    // ... other view code (if any)
    WorkflowView(launchingWith: "Skip optional screen") {
        WorkflowItem(OptionalView.self)
        WorkflowItem(ExampleView.self)
    }
}

And 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.

Server Driven Workflows

SwiftCurrent 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.

Look at Our Example Apps

We have example apps 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.

Click Here to Learn More

For specific documentation check out:

Feedback

If you like what you've seen, consider giving us a star! If you don't, let us know how we can improve.

Stars

Special Thanks

SwiftCurrent would not be nearly as amazing without all of the great work done by the authors of our test dependencies:

More Resources
to explore the angular.

mail [email protected] to add your project or resources here ๐Ÿ”ฅ.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here ๐Ÿ”.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory