All Projects → wwt → SwiftCurrent

wwt / SwiftCurrent

Licence: Apache-2.0 license
A library for managing complex workflows in Swift

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to SwiftCurrent

Swifterswift
A handy collection of more than 500 native Swift extensions to boost your productivity.
Stars: ✭ 10,706 (+3643.36%)
Mutual labels:  tvos, watchos, uikit, swift-package-manager
Swiftlinkpreview
It makes a preview from an URL, grabbing all the information such as title, relevant texts and images.
Stars: ✭ 1,216 (+325.17%)
Mutual labels:  tvos, watchos, swift-package-manager
Waterfallgrid
A waterfall grid layout view for SwiftUI.
Stars: ✭ 1,086 (+279.72%)
Mutual labels:  tvos, watchos, swift-package-manager
ScaledFont
ScaledFont - Using custom fonts with dynamic type
Stars: ✭ 50 (-82.52%)
Mutual labels:  tvos, watchos, swiftui
Wwdc
You don't have the time to watch all the WWDC session videos yourself? No problem me and many contributors extracted the gist for you 🥳
Stars: ✭ 2,561 (+795.45%)
Mutual labels:  tvos, watchos, swiftui
Swiftui
A collaborative list of awesome SwiftUI resources. Feel free to contribute!
Stars: ✭ 774 (+170.63%)
Mutual labels:  tvos, watchos, uikit
Swiftui Kit
A SwiftUI system components and interactions demo app
Stars: ✭ 1,733 (+505.94%)
Mutual labels:  tvos, watchos, swiftui
Functionkit
A framework for functional types and operations designed to fit naturally into Swift.
Stars: ✭ 302 (+5.59%)
Mutual labels:  tvos, watchos, swift-package-manager
Opencombine
Open source implementation of Apple's Combine framework for processing values over time.
Stars: ✭ 2,040 (+613.29%)
Mutual labels:  tvos, watchos, swift-package-manager
Ducttape
📦 KeyPath dynamicMemberLookup based syntax sugar for Swift.
Stars: ✭ 138 (-51.75%)
Mutual labels:  tvos, watchos, swift-package-manager
WWDCNotes
WWDCNotes.com content
Stars: ✭ 343 (+19.93%)
Mutual labels:  tvos, watchos, swiftui
Open Source Ios Apps
📱 Collaborative List of Open-Source iOS Apps
Stars: ✭ 28,826 (+9979.02%)
Mutual labels:  tvos, watchos, swiftui
Guitar
A Cross-Platform String and Regular Expression Library written in Swift.
Stars: ✭ 641 (+124.13%)
Mutual labels:  tvos, watchos, swift-package-manager
Queuer
Queuer is a queue manager, built on top of OperationQueue and Dispatch (aka GCD).
Stars: ✭ 964 (+237.06%)
Mutual labels:  tvos, watchos, swift-package-manager
Swiftframeworktemplate
A template for new Swift iOS / macOS / tvOS / watchOS Framework project ready with travis-ci, cocoapods, Carthage, SwiftPM and a Readme file
Stars: ✭ 527 (+84.27%)
Mutual labels:  tvos, watchos, swift-package-manager
L10n Swift
Localization of the application with ability to change language "on the fly" and support for plural form in any language.
Stars: ✭ 177 (-38.11%)
Mutual labels:  tvos, watchos, swift-package-manager
Skeletonui
☠️ Elegant skeleton loading animation in SwiftUI and Combine
Stars: ✭ 275 (-3.85%)
Mutual labels:  tvos, watchos, swift-package-manager
Web3.swift
A pure swift Ethereum Web3 library
Stars: ✭ 295 (+3.15%)
Mutual labels:  tvos, watchos, swift-package-manager
Surmagic
🚀 The better way to deal with Binary Frameworks on iOS, Mac Catalyst, tvOS, macOS, and watchOS. Create XCFrameworks with ease.
Stars: ✭ 119 (-58.39%)
Mutual labels:  tvos, watchos, swift-package-manager
Cdmarkdownkit
An extensive Swift framework providing simple and customizable markdown parsing.
Stars: ✭ 158 (-44.76%)
Mutual labels:  tvos, watchos, swift-package-manager

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:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].