Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ struct DocsPostProcessor: ParsableCommand {
@Flag(help: "Replaces overview in the left navigation with rendered README")
var replaceOverviewWithReadme = false

@Flag(help: "Replaces readme video link with an embedded vimeo player")
var replaceReadmeVideoWithVimeoEmbed = false

@Argument(help: "The file, or directory with the HTML to change")
var path: String

Expand All @@ -34,10 +31,6 @@ struct DocsPostProcessor: ParsableCommand {
try replaceOverviewWithReadme(document: doc)
print("Replaced overview with README for: \(file.absoluteString)")
}
if replaceReadmeVideoWithVimeoEmbed, file.lastPathComponent == "index.html" {
try replaceReadmeVideoWithVimeoEmbed(document: doc)
print("Replaced readme video with vimeo embed")
}
try doc.html().write(to: file, atomically: true, encoding: .utf8)
}
}
Expand All @@ -53,13 +46,4 @@ struct DocsPostProcessor: ParsableCommand {
}
}
}

func replaceReadmeVideoWithVimeoEmbed(document: Document) throws {
if let article = try? document.select("article").first() {
let link = try article.getElementsByAttributeValue("href", "https://user-images.githubusercontent.com/33705774/132767762-7447753c-feba-4ef4-b54c-38bfe9d1ee82.mp4")
try link.wrap("""
<div style="padding:56.25% 0 0 0;position:relative;"><iframe src="https://player.vimeo.com/video/600610695?badge=0&amp;autopause=0&amp;player_id=0&amp;app_id=58479&amp;h=fd3976b77a" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen style="position:absolute;top:0;left:0;width:100%;height:100%;" title="Introducing SwiftCurrent.mp4"></iframe></div><script src="https://player.vimeo.com/api/player.js"></script>
""")
}
}
}
2 changes: 1 addition & 1 deletion .github/document.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ rm swiftcurrent-docs.json
rm swiftcurrentuikit-docs.json
rm swiftcurrent-swiftui-docs.json
cd .github/DocsPostProcessor
./DocsPostProcessor ../../Docs --replace-overview-with-readme --replace-readme-video-with-vimeo-embed
./DocsPostProcessor ../../Docs --replace-overview-with-readme
open ../../docs/index.html
4 changes: 2 additions & 2 deletions .github/workflows/validate_urls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
branch: ${{ env.GIT_BRANCH }}
file_types: .md,.swift
exclude_urls: https://github.com/wwt/SwiftCurrent/discussions/new
exclude_patterns: https://img.shields.io
exclude_patterns: https://img.shields.io,https://codecov.io
- name: slack-send
if: failure()
uses: slackapi/slack-github-action@v1.16.0
Expand All @@ -48,7 +48,7 @@ jobs:
branch: gh-pages
file_types: .html,.css,.scss
exclude_urls: https://github.com/wwt/SwiftCurrent/discussions/new,https://github.com/realm/jazzy,https://realm.io,https://github.com/wwt/SwiftCurrent
exclude_patterns: https://img.shields.io, https://codecov.io/gh/wwt/SwiftCurrent
exclude_patterns: https://img.shields.io,https://codecov.io
- name: slack-send
if: failure()
uses: slackapi/slack-github-action@v1.16.0
Expand Down
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,31 @@
[![Build Status](https://github.com/wwt/SwiftCurrent/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/wwt/SwiftCurrent/actions?query=branch%3Amain)
[![Code Coverage](https://codecov.io/gh/wwt/SwiftCurrent/branch/main/graph/badge.svg?token=04Q5KSHict)](https://codecov.io/gh/wwt/SwiftCurrent)


# Welcome

SwiftCurrent is a library that lets you easily manage journeys through your Swift application.
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.

It comes with built-in support for UIKit and SwiftUI app-routing. 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.
## Why Should I Use SwiftCurrent?

https://user-images.githubusercontent.com/33705774/132767762-7447753c-feba-4ef4-b54c-38bfe9d1ee82.mp4
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.

### Why Should I Use SwiftCurrent?
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
### 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](https://wwt.github.io/SwiftCurrent/installation.html).

```swift
Expand All @@ -40,7 +41,9 @@ Why show a quick start when we have an example app? Because it's so easy to get
.product(name: "SwiftCurrent", package: "SwiftCurrent"),
.product(name: "SwiftCurrent_SwiftUI", package: "SwiftCurrent")
```

Then make your first FlowRepresentable view:

```swift
import SwiftCurrent
import SwiftUI
Expand All @@ -56,7 +59,9 @@ struct ExampleView: View, PassthroughFlowRepresentable {
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:

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

```swift
import SwiftCurrent_SwiftUI
// ...
Expand All @@ -72,10 +77,13 @@ var body: some View {
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.](https://wwt.github.io/SwiftCurrent/How%20to%20use%20SwiftCurrent%20with%20SwiftUI.html)

# Look at Our Example Apps
We 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.

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

# [Click Here to Learn More](https://wwt.github.io/SwiftCurrent/Creating%20Workflows.html)

For specific documentation check out:

- [Why SwiftCurrent?](https://wwt.github.io/SwiftCurrent/why-this-library.html)
- [Installation](https://wwt.github.io/SwiftCurrent/installation.html)
- [Getting Started With SwiftUI](https://wwt.github.io/SwiftCurrent/getting-started-with-swiftui.html)
Expand Down