Skip to content

[DNM WIP] SwiftUI testbed app #240

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

Closed
wants to merge 28 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ccbec00
paste in WorkflowSwiftUI types
square-tomb May 25, 2023
af1499d
try adding dependency on MarketWorkflowUI
square-tomb Aug 10, 2023
159fb94
specify Market version compatible w/ Workflow 3.0
square-tomb Aug 10, 2023
b8d48b1
add SwiftUITestbed sample app
square-tomb Aug 10, 2023
74d3a5f
allow pushing screen onto backstack
square-tomb Aug 11, 2023
41c5de1
allow presenting a screen modally
square-tomb Aug 11, 2023
2e2cbfe
separate RootWorkflow from MainWorkflow
square-tomb Aug 11, 2023
90defdb
add editable title
square-tomb Aug 11, 2023
0f1642a
push another MainScreen instead of a placeholder
square-tomb Aug 11, 2023
76483f3
show Close button when modal can be dismissed
square-tomb Aug 14, 2023
b31d73c
add Caps toggle
square-tomb Aug 15, 2023
33d88b1
disable toggle when title empty
square-tomb Aug 15, 2023
3ceb958
use FocusState
square-tomb Aug 15, 2023
133088f
move source files to correct location
square-tomb Aug 16, 2023
52f9c04
add tests
square-tomb Aug 17, 2023
e2bb48c
Revert "paste in WorkflowSwiftUI types"
square-tomb Aug 25, 2023
6778afb
organize UI
square-tomb Aug 25, 2023
e91728f
remove PlaceholderScreen
square-tomb Aug 25, 2023
05a14ef
Update Samples/SwiftUITestbed/Sources/AppDelegate.swift
square-tomb Sep 27, 2023
92b6a5e
use preferred modal presentation syntax
square-tomb Sep 27, 2023
e116cfa
add Resign Focus button
square-tomb Sep 27, 2023
1857f0c
revert change to Gemfile.lock
square-tomb Sep 27, 2023
cee500b
update Market dependency
square-tomb Sep 28, 2023
4942daa
add SwiftUI Preview
square-tomb Sep 28, 2023
11ff615
Abstract ToggleRow component
n8chur Sep 28, 2023
8200320
wrap preview in #if DEBUG
square-tomb Oct 4, 2023
61e8bb7
remove unneeded external_source_pods declaration
square-tomb Oct 4, 2023
b63c2d4
Merge branch 'main' of github.com:square/workflow-swift into tomb/swi…
square-tomb Nov 4, 2023
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
20 changes: 19 additions & 1 deletion Samples/SwiftUITestbed/Sources/MainScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@
import BlueprintUI
import MarketUI
import MarketWorkflowUI
import SwiftUI
import ViewEnvironment

struct MainScreen: MarketScreen {
enum Field: Hashable {
case title
}

@FocusState var focusedField: Field?
@BlueprintUI.FocusState var focusedField: Field?

let title: String
let didChangeTitle: (String) -> Void
Expand Down Expand Up @@ -120,3 +121,20 @@ extension MainScreen: MarketBackStackContentScreen {

var backStackIdentifier: AnyHashable? { nil }
}

struct MainScreen_Preview: PreviewProvider {
static var previews: some View {
MainScreen(
title: "New item",
didChangeTitle: { _ in },
allCapsToggleIsOn: true,
allCapsToggleIsEnabled: true,
didChangeAllCapsToggle: { _ in },
didTapPushScreen: {},
didTapPresentScreen: {},
didTapClose: {}
)
.asMarketBackStack()
.marketPreview()
}
}