Skip to content

Commit a4de618

Browse files
committed
Merge remote-tracking branch 'origin/main' into jquadri/exp-anyworkflow-workflow-conformance
* origin/main: Expose AnyScreen.wrappedScreen for inspection (#193) Improve introspection for SignalProducerWorkflow actions (#192) [release]: bump version to 2.2.0 & remove separate concurrency version (#191) [feat]: add runtime observation API (#168) [chore]: refactor some internal actions to use existential any (#190) [fix]: use weak reference to internal sinks when vending to clients (#189) [feat]: add primary associated types to more protocols (#188) [chore]: pre major version bump cleanup (#187) [chore]: bump minimum deployment & swift versions (#186) Abstract ViewEnvironment to shared framework (#185)
2 parents 67393fe + 99024b5 commit a4de618

File tree

83 files changed

+1742
-536
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+1742
-536
lines changed

.github/workflows/swift.yaml

+6-6
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ jobs:
4141
bundle exec pod gen Development.podspec
4242
4343
- name: Switch Xcode
44-
run: sudo xcode-select -s /Applications/Xcode_13.3.1.app
44+
run: sudo xcode-select -s /Applications/Xcode_14.2.0.app
4545

4646
- name: Build & Test
4747
run: |
48-
set -o pipefail && xcodebuild -workspace gen/Development/Development.xcworkspace -scheme ${{ matrix.scheme }} -destination platform\=iOS\ Simulator,OS\=15.4,name\=iPad\ Pro\ \(9.7-inch\) build test | xcpretty
48+
set -o pipefail && xcodebuild -workspace gen/Development/Development.xcworkspace -scheme ${{ matrix.scheme }} -destination platform\=iOS\ Simulator,OS\=16.2,name\=iPad\ Pro\ \(9.7-inch\) build test | xcpretty
4949
5050
spm:
5151
runs-on: macos-latest
@@ -54,7 +54,7 @@ jobs:
5454
- uses: actions/checkout@v3
5555

5656
- name: Switch Xcode
57-
run: sudo xcode-select -s /Applications/Xcode_13.3.1.app
57+
run: sudo xcode-select -s /Applications/Xcode_14.2.0.app
5858

5959
- name: Swift Package Manager - iOS
6060
run: |
@@ -81,13 +81,13 @@ jobs:
8181
bundle check || bundle install --path .bundle
8282
8383
- name: Switch Xcode
84-
run: sudo xcode-select -s /Applications/Xcode_13.3.1.app
84+
run: sudo xcode-select -s /Applications/Xcode_14.2.0.app
8585

8686
- name: Tutorial App
8787
run: |
8888
cd Samples/Tutorial
8989
bundle exec pod install
90-
set -o pipefail && xcodebuild -workspace Tutorial.xcworkspace -scheme Tutorial -destination platform\=iOS\ Simulator,OS\=15.4,name\=iPad\ Pro\ \(9.7-inch\) build test | xcpretty
90+
set -o pipefail && xcodebuild -workspace Tutorial.xcworkspace -scheme Tutorial -destination platform\=iOS\ Simulator,OS\=16.2,name\=iPad\ Pro\ \(9.7-inch\) build test | xcpretty
9191
9292
documentation-lint:
9393
runs-on: macos-latest
@@ -107,7 +107,7 @@ jobs:
107107
brew install sourcedocs
108108
109109
- name: Switch Xcode
110-
run: sudo xcode-select -s /Applications/Xcode_13.3.1.app
110+
run: sudo xcode-select -s /Applications/Xcode_14.2.0.app
111111

112112
- name: Swiftdocs
113113
run: |

Development.podspec

+55-57
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
require_relative('version')
2+
13
Pod::Spec.new do |s|
24
s.name = 'Development'
35
s.version = '0.1.0'
@@ -7,14 +9,15 @@ Pod::Spec.new do |s|
79
s.author = 'Square'
810
s.source = { :git => 'https://github.com/square/workflow-swift.git', :tag => "v#{s.version}" }
911

10-
s.ios.deployment_target = '11.0'
11-
s.swift_version = '5.0'
12+
s.ios.deployment_target = WORKFLOW_IOS_DEPLOYMENT_TARGET
13+
s.swift_version = WORKFLOW_SWIFT_VERSION
1214
s.dependency 'Workflow'
1315
s.dependency 'WorkflowUI'
1416
s.dependency 'WorkflowReactiveSwift'
1517
s.dependency 'WorkflowRxSwift'
16-
# s.dependency 'WorkflowCombine' # TODO: Disabled because app specs cannot increase the deployment target of the root
17-
# s.dependency 'WorkflowConcurrency' # TODO: Disabled because app specs cannot increase the deployment target of the root
18+
s.dependency 'WorkflowCombine'
19+
s.dependency 'WorkflowConcurrency'
20+
s.dependency 'ViewEnvironment'
1821

1922
s.source_files = 'Samples/Dummy.swift'
2023

@@ -44,17 +47,14 @@ Pod::Spec.new do |s|
4447
test_spec.source_files = 'WorkflowTesting/Tests/**/*.swift'
4548
end
4649

47-
# TODO: Disabled because app specs cannot increase the deployment target of the root
48-
# To use, increase the deployment target of this spec to 13.0 or higher
49-
#
50-
# s.app_spec 'SampleSwiftUIApp' do |app_spec|
51-
# app_spec.ios.deployment_target = '13.0'
52-
# app_spec.dependency 'WorkflowSwiftUI'
53-
# app_spec.pod_target_xcconfig = {
54-
# 'IFNFOPLIST_FILE' => '${PODS_ROOT}/../Samples/SampleSwiftUIApp/SampleSwiftUIApp/Configuration/Info.plist'
55-
# }
56-
# app_spec.source_files = 'SampleSwiftUIApp/SampleSwiftUIApp/**/*.swift'
57-
# end
50+
s.app_spec 'SampleSwiftUIApp' do |app_spec|
51+
app_spec.ios.deployment_target = WORKFLOW_IOS_DEPLOYMENT_TARGET
52+
app_spec.dependency 'WorkflowSwiftUI'
53+
app_spec.pod_target_xcconfig = {
54+
'IFNFOPLIST_FILE' => '${PODS_ROOT}/../Samples/SampleSwiftUIApp/SampleSwiftUIApp/Configuration/Info.plist'
55+
}
56+
app_spec.source_files = 'Samples/SampleSwiftUIApp/SampleSwiftUIApp/**/*.swift'
57+
end
5858

5959
s.app_spec 'SampleTicTacToe' do |app_spec|
6060
app_spec.source_files = 'Samples/TicTacToe/Sources/**/*.swift'
@@ -145,48 +145,46 @@ Pod::Spec.new do |s|
145145
test_spec.dependency 'WorkflowRxSwiftTesting'
146146
end
147147

148-
# TODO: Disabled because app specs cannot increase the deployment target of the root
149-
# To use, increase the deployment target of this spec to 13.0 or higher
150-
# s.app_spec 'WorkflowCombineSampleApp' do |app_spec|
151-
# app_spec.source_files = 'Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/**/*.swift'
152-
# end
153-
#
154-
# s.test_spec 'WorkflowCombineSampleAppTests' do |test_spec|
155-
# test_spec.dependency 'Development/WorkflowCombineSampleApp'
156-
# test_spec.dependency 'WorkflowTesting'
157-
# test_spec.requires_app_host = true
158-
# test_spec.app_host_name = 'Development/WorkflowCombineSampleApp'
159-
# test_spec.source_files = 'Samples/WorkflowCombineSampleApp/WorkflowCombineSampleAppUnitTests/**/*.swift'
160-
# end
161-
162-
# s.test_spec 'WorkflowCombineTests' do |test_spec|
163-
# test_spec.requires_app_host = true
164-
# test_spec.source_files = 'WorkflowCombine/Tests/**/*.swift'
165-
# test_spec.framework = 'XCTest'
166-
# test_spec.dependency 'WorkflowTesting'
167-
# test_spec.dependency 'WorkflowCombineTesting'
168-
# end
169-
170-
# s.test_spec 'WorkflowCombineTestingTests' do |test_spec|
171-
# test_spec.requires_app_host = true
172-
# test_spec.source_files = 'WorkflowCombine/TestingTests/**/*.swift'
173-
# test_spec.framework = 'XCTest'
174-
# test_spec.dependency 'WorkflowTesting'
175-
# test_spec.dependency 'WorkflowCombineTesting'
176-
# end
148+
s.app_spec 'WorkflowCombineSampleApp' do |app_spec|
149+
app_spec.source_files = 'Samples/WorkflowCombineSampleApp/WorkflowCombineSampleApp/**/*.swift'
150+
end
151+
152+
s.test_spec 'WorkflowCombineSampleAppTests' do |test_spec|
153+
test_spec.dependency 'Development/WorkflowCombineSampleApp'
154+
test_spec.dependency 'WorkflowTesting'
155+
test_spec.requires_app_host = true
156+
test_spec.app_host_name = 'Development/WorkflowCombineSampleApp'
157+
test_spec.source_files = 'Samples/WorkflowCombineSampleApp/WorkflowCombineSampleAppUnitTests/**/*.swift'
158+
end
159+
160+
s.test_spec 'WorkflowCombineTests' do |test_spec|
161+
test_spec.requires_app_host = true
162+
test_spec.source_files = 'WorkflowCombine/Tests/**/*.swift'
163+
test_spec.framework = 'XCTest'
164+
test_spec.dependency 'WorkflowTesting'
165+
test_spec.dependency 'WorkflowCombineTesting'
166+
end
167+
168+
s.test_spec 'WorkflowCombineTestingTests' do |test_spec|
169+
test_spec.requires_app_host = true
170+
test_spec.source_files = 'WorkflowCombine/TestingTests/**/*.swift'
171+
test_spec.framework = 'XCTest'
172+
test_spec.dependency 'WorkflowTesting'
173+
test_spec.dependency 'WorkflowCombineTesting'
174+
end
177175

178-
# s.test_spec 'WorkflowConcurrencyTests' do |test_spec|
179-
# test_spec.requires_app_host = true
180-
# test_spec.source_files = 'WorkflowConcurrency/Tests/**/*.swift'
181-
# test_spec.framework = 'XCTest'
182-
# test_spec.dependency 'WorkflowTesting'
183-
# end
176+
s.test_spec 'WorkflowConcurrencyTests' do |test_spec|
177+
test_spec.requires_app_host = true
178+
test_spec.source_files = 'WorkflowConcurrency/Tests/**/*.swift'
179+
test_spec.framework = 'XCTest'
180+
test_spec.dependency 'WorkflowTesting'
181+
end
184182

185-
# s.test_spec 'WorkflowConcurrencyTestingTests' do |test_spec|
186-
# test_spec.requires_app_host = true
187-
# test_spec.source_files = 'WorkflowConcurrency/TestingTests/**/*.swift'
188-
# test_spec.framework = 'XCTest'
189-
# test_spec.dependency 'WorkflowTesting'
190-
# test_spec.dependency 'WorkflowConcurrencyTesting'
191-
# end
183+
s.test_spec 'WorkflowConcurrencyTestingTests' do |test_spec|
184+
test_spec.requires_app_host = true
185+
test_spec.source_files = 'WorkflowConcurrency/TestingTests/**/*.swift'
186+
test_spec.framework = 'XCTest'
187+
test_spec.dependency 'WorkflowTesting'
188+
test_spec.dependency 'WorkflowConcurrencyTesting'
189+
end
192190
end

Gemfile

-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,4 @@ source 'https://rubygems.org'
33
gem 'cocoapods-trunk', '>=1.6.0'
44
gem 'cocoapods'
55

6-
# Need it for Ruby 3.0 support and no release has happened yet
7-
gem 'cocoapods-disable-podfile-validations', :git => 'https://github.com/segiddins/cocoapods-disable-podfile-validations.git', :ref => '55598d677fa995be496a47b810f4f9dce732b169'
86
gem 'cocoapods-generate'

Gemfile.lock

+3-10
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
GIT
2-
remote: https://github.com/segiddins/cocoapods-disable-podfile-validations.git
3-
revision: 55598d677fa995be496a47b810f4f9dce732b169
4-
ref: 55598d677fa995be496a47b810f4f9dce732b169
5-
specs:
6-
cocoapods-disable-podfile-validations (0.1.1)
7-
81
GEM
92
remote: https://rubygems.org/
103
specs:
@@ -52,9 +45,10 @@ GEM
5245
public_suffix (~> 4.0)
5346
typhoeus (~> 1.0)
5447
cocoapods-deintegrate (1.0.5)
48+
cocoapods-disable-podfile-validations (0.2.0)
5549
cocoapods-downloader (1.6.3)
56-
cocoapods-generate (2.2.2)
57-
cocoapods-disable-podfile-validations (~> 0.1.1)
50+
cocoapods-generate (2.2.3)
51+
cocoapods-disable-podfile-validations (>= 0.1.1, < 0.3.0)
5852
cocoapods-plugins (1.0.0)
5953
nap
6054
cocoapods-search (1.0.1)
@@ -101,7 +95,6 @@ PLATFORMS
10195

10296
DEPENDENCIES
10397
cocoapods
104-
cocoapods-disable-podfile-validations!
10598
cocoapods-generate
10699
cocoapods-trunk (>= 1.6.0)
107100

Package.swift

+19-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
// swift-tools-version:5.2
1+
// swift-tools-version:5.7
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription
55

66
let package = Package(
77
name: "Workflow",
88
platforms: [
9-
.iOS("11.0"),
10-
.macOS("10.13"),
9+
.iOS("14.0"),
10+
.macOS("10.15"),
1111
],
1212
products: [
1313
// MARK: Workflow
@@ -75,11 +75,18 @@ let package = Package(
7575
name: "WorkflowConcurrencyTesting",
7676
targets: ["WorkflowConcurrencyTesting"]
7777
),
78+
79+
// MARK: ViewEnvironment
80+
81+
.library(
82+
name: "ViewEnvironment",
83+
targets: ["ViewEnvironment"]
84+
),
7885
],
7986
dependencies: [
8087
.package(url: "https://github.com/ReactiveCocoa/ReactiveSwift.git", from: "7.1.1"),
8188
.package(url: "https://github.com/ReactiveX/RxSwift.git", from: "6.2.0"),
82-
.package(url: "https://github.com/nicklockwood/SwiftFormat", .exact("0.44.14")),
89+
.package(url: "https://github.com/nicklockwood/SwiftFormat", exact: "0.44.14"),
8390
],
8491
targets: [
8592
// MARK: Workflow
@@ -109,7 +116,7 @@ let package = Package(
109116

110117
.target(
111118
name: "WorkflowUI",
112-
dependencies: ["Workflow"],
119+
dependencies: ["Workflow", "ViewEnvironment"],
113120
path: "WorkflowUI/Sources"
114121
),
115122
.testTarget(
@@ -214,6 +221,13 @@ let package = Package(
214221
dependencies: ["WorkflowConcurrencyTesting"],
215222
path: "WorkflowConcurrency/TestingTests"
216223
),
224+
225+
// MARK: ViewEnvironment
226+
227+
.target(
228+
name: "ViewEnvironment",
229+
path: "ViewEnvironment/Sources"
230+
),
217231
],
218232
swiftLanguageVersions: [.v5]
219233
)

RELEASING.md

+2-8
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,7 @@ For Squares, membership is managed through the `Workflow Swift Owners` registry
1717

1818
> ⚠️ [Optional] To avoid possible headaches when publishing podspecs, validation can be performed before updating the Workflow version number(s). To do this, run the following in the root directory of this repo:
1919
> ```bash
20-
> bundle exec pod lib lint Workflow.podspec WorkflowTesting.podspec WorkflowReactiveSwift.podspec WorkflowUI.podspec WorkflowRxSwift.podspec WorkflowReactiveSwiftTesting.podspec WorkflowRxSwiftTesting.podspec WorkflowSwiftUI.podspec WorkflowCombine.podspec WorkflowCombineTesting.podspec
21-
> ```
22-
> And then run a similar command to check the `WorkflowConcurrency*` libraries. These specs will fail default validation as their version differs from the git tag used, so run the command with the `--allow-warnings` option, and check that only that warning is produced.
23-
> ```bash
24-
> bundle exec pod lib lint WorkflowConcurrency.podspec WorkflowConcurrencyTesting.podspec --allow-warnings
20+
> bundle exec pod lib lint Workflow.podspec ViewEnvironment.podspec WorkflowTesting.podspec WorkflowReactiveSwift.podspec WorkflowUI.podspec WorkflowRxSwift.podspec WorkflowReactiveSwiftTesting.podspec WorkflowRxSwiftTesting.podspec WorkflowSwiftUI.podspec WorkflowCombine.podspec WorkflowCombineTesting.podspec WorkflowConcurrency.podspec WorkflowConcurrencyTesting.podspec
2521
> ```
2622
2723
1. Update `VERSION` file based on [`semver`](https://semver.org/).
@@ -40,16 +36,14 @@ For Squares, membership is managed through the `Workflow Swift Owners` registry
4036
bundle exec pod trunk push Workflow.podspec --synchronous
4137
bundle exec pod trunk push WorkflowTesting.podspec --synchronous
4238
bundle exec pod trunk push WorkflowReactiveSwift.podspec --synchronous
39+
bundle exec pod trunk push ViewEnvironment.podspec --synchronous
4340
bundle exec pod trunk push WorkflowUI.podspec --synchronous
4441
bundle exec pod trunk push WorkflowRxSwift.podspec --synchronous
4542
bundle exec pod trunk push WorkflowReactiveSwiftTesting.podspec --synchronous
4643
bundle exec pod trunk push WorkflowRxSwiftTesting.podspec --synchronous
4744
bundle exec pod trunk push WorkflowSwiftUI.podspec --synchronous
4845
bundle exec pod trunk push WorkflowCombine.podspec --synchronous
4946
bundle exec pod trunk push WorkflowCombineTesting.podspec --synchronous
50-
51-
# Note: If the following fail due to a validation warning about their version number not matching the git tag,
52-
# it is safe to ignore, and publish anyway by adding the `--allow-warnings` option to the command.
5347
bundle exec pod trunk push WorkflowConcurrency.podspec --synchronous
5448
bundle exec pod trunk push WorkflowConcurrencyTesting.podspec --synchronous
5549
```

Samples/AlertContainer/AlertContainer.podspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ Pod::Spec.new do |s|
1010
# 1.7 is needed for `swift_versions` support
1111
s.cocoapods_version = '>= 1.7.0'
1212

13-
s.swift_versions = ['5.0']
14-
s.ios.deployment_target = '11.0'
13+
s.swift_versions = [WORKFLOW_SWIFT_VERSION]
14+
s.ios.deployment_target = WORKFLOW_IOS_DEPLOYMENT_TARGET
1515

1616
s.source_files = 'Sources/**/*.swift'
1717

Samples/BackStackContainer/BackStackContainer.podspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ Pod::Spec.new do |s|
1010
# 1.7 is needed for `swift_versions` support
1111
s.cocoapods_version = '>= 1.7.0'
1212

13-
s.swift_versions = ['5.0']
14-
s.ios.deployment_target = '11.0'
13+
s.swift_versions = [WORKFLOW_SWIFT_VERSION]
14+
s.ios.deployment_target = WORKFLOW_IOS_DEPLOYMENT_TARGET
1515

1616
s.source_files = 'Sources/**/*.{swift}'
1717

Samples/ModalContainer/ModalContainer.podspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ Pod::Spec.new do |s|
1010
# 1.7 is needed for `swift_versions` support
1111
s.cocoapods_version = '>= 1.7.0'
1212

13-
s.swift_versions = ['5.0']
14-
s.ios.deployment_target = '11.0'
13+
s.swift_versions = [WORKFLOW_SWIFT_VERSION]
14+
s.ios.deployment_target = WORKFLOW_IOS_DEPLOYMENT_TARGET
1515

1616
s.source_files = 'Sources/**/*.swift'
1717

Samples/ModalContainer/Sources/ModalContainerViewController.swift

+2-4
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,8 @@ internal final class ModalContainerViewController<ModalScreen: Screen>: ScreenVi
162162

163163
setNeedsStatusBarAppearanceUpdate()
164164

165-
if #available(iOS 11.0, *) {
166-
setNeedsUpdateOfHomeIndicatorAutoHidden()
167-
setNeedsUpdateOfScreenEdgesDeferringSystemGestures()
168-
}
165+
setNeedsUpdateOfHomeIndicatorAutoHidden()
166+
setNeedsUpdateOfScreenEdgesDeferringSystemGestures()
169167

170168
// Set the topmost screen to be the accessibility modal
171169
presentedScreens.last?.viewController.view.accessibilityViewIsModal = true

Samples/SampleApp/Podfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
project 'SampleApp.xcodeproj'
2-
platform :ios, '9.3'
2+
platform :ios, '14.0'
33

44
target 'SampleApp' do
55
pod 'Workflow', path: '../../Workflow.podspec', :testspecs => ['Tests']

Samples/SampleSwiftUIApp/Podfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
project 'SampleSwiftUIApp.xcodeproj'
2-
platform :ios, '13'
2+
platform :ios, '14.0'
33

44
target 'SampleSwiftUIApp' do
55
pod 'Workflow', path: '../../Workflow.podspec', :testspecs => ['Tests']

Samples/SplitScreenContainer/Sources/SplitScreenContainerViewController.swift

+1-5
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,6 @@ internal final class SplitScreenContainerViewController<LeadingScreenType: Scree
120120

121121
private extension UIViewController {
122122
var isLayoutDirectionRightToLeft: Bool {
123-
if #available(iOS 10.0, *) {
124-
return traitCollection.layoutDirection == .rightToLeft
125-
} else {
126-
return UIView.userInterfaceLayoutDirection(for: view.semanticContentAttribute) == .rightToLeft
127-
}
123+
return traitCollection.layoutDirection == .rightToLeft
128124
}
129125
}

0 commit comments

Comments
 (0)