Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Working with Modals.md #141

Merged
merged 1 commit into from
Sep 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/guides/Working with Modals.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
### Presentation Types
When you are constructing a workflow you can use `WorkflowItem.presentationType(_:)` along with a valid `LaunchStyle.SwiftUI.PresentationType` to control how a `FlowRepresentable` will be displayed. This is how you'll describe your modals and keep your view ignorant of the context it's displayed in.
When constructing a workflow, you can use `WorkflowItem.presentationType(_:)` along with a valid `LaunchStyle.SwiftUI.PresentationType` to control how a `FlowRepresentable` will be displayed. This is how you'll describe your modals and keep your view ignorant of the context it's displayed in.

#### Example:
#### Example
```swift
NavigationView {
WorkflowLauncher(isLaunched: .constant(true)) {
Expand All @@ -12,15 +12,15 @@ NavigationView {
}
```

With that you've described that `FirstView` should be presented normally. When it calls `FlowRepresentable.proceedInWorkflow()` it'll present `SecondView` using the default SwiftUI modal (sheet).
With that, you've described that `FirstView` should be presented normally. When it calls `FlowRepresentable.proceedInWorkflow()`, it'll present `SecondView` using the default SwiftUI modal (sheet).

> NOTE: Unlike `LaunchStyle.SwiftUI.PresentationType.navigationLink` you apply `LaunchStyle.SwiftUI.PresentationType.modal` to a view that should be launched modally.
> **NOTE:** Unlike `LaunchStyle.SwiftUI.PresentationType.navigationLink`, you apply `LaunchStyle.SwiftUI.PresentationType.modal` to a view that should be launched modally.

### Different Modal Styles
When you use a presentation type of `LaunchStyle.SwiftUI.PresentationType.modal` you can optionally pass it a `LaunchStyle.SwiftUI.ModalPresentationStyle`.
When you use a presentation type of `LaunchStyle.SwiftUI.PresentationType.modal`, you can optionally pass it a `LaunchStyle.SwiftUI.ModalPresentationStyle`.

#### Example:
The following will use a full screen cover:
#### Example
The following will use a full-screen cover:
```swift
NavigationView {
WorkflowLauncher(isLaunched: .constant(true)) {
Expand All @@ -29,4 +29,4 @@ NavigationView {
}
}
}
```
```