Skip to content

Commit 51146e6

Browse files
authored
[CI] Add disabled tests for visionOS (#333)
1 parent b7c9a81 commit 51146e6

Some content is hidden

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

46 files changed

+148
-142
lines changed

.github/workflows/ci.yml

+8-9
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,14 @@ jobs:
132132
# os: macos-14
133133
# xcode: 15.4
134134

135-
# - platform: [visionOS, 1]
136-
# runtime: visionOS 1.2
137-
# os: macos-14
138-
# xcode: 15.4
135+
- platform: [visionOS, 1]
136+
runtime: visionOS 1.2
137+
os: macos-14
138+
xcode: 15.4
139+
- platform: [visionOS, 2]
140+
runtime: visionOS 2.0
141+
os: macos-14
142+
xcode: 16.0
139143
steps:
140144
- name: Git Checkout
141145
uses: actions/checkout@v4
@@ -148,11 +152,6 @@ jobs:
148152
- name: Set environment variables
149153
run: echo "SKIP_SLOW_FASTLANE_WARNING=1" >> $GITHUB_ENV
150154

151-
- if: ${{ matrix.platform[0] == 'visionOS' }}
152-
run: |
153-
defaults write com.apple.dt.Xcode AllowUnsupportedVisionOSHost -bool YES
154-
defaults write com.apple.CoreSimulator AllowUnsupportedVisionOSHost -bool YES
155-
156155
- name: Select Xcode version
157156
run: sudo xcodes select ${{ matrix.xcode }}
158157

Examples/Showcase/Showcase/AppView.swift

+19-19
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ struct AppView: View {
77
#if os(iOS) || os(tvOS) || os(visionOS)
88
.introspect(
99
.window,
10-
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18), .visionOS(.v1)
10+
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18), .visionOS(.v1, .v2)
1111
) { window in
1212
window.backgroundColor = .brown
1313
}
@@ -87,7 +87,7 @@ struct ListShowcase: View {
8787
tableView.backgroundView = UIView()
8888
tableView.backgroundColor = .cyan
8989
}
90-
.introspect(.list, on: .iOS(.v16, .v17, .v18), .visionOS(.v1)) { collectionView in
90+
.introspect(.list, on: .iOS(.v16, .v17, .v18), .visionOS(.v1, .v2)) { collectionView in
9191
collectionView.backgroundView = UIView()
9292
collectionView.subviews.dropFirst(1).first?.backgroundColor = .cyan
9393
}
@@ -112,7 +112,7 @@ struct ListShowcase: View {
112112
tableView.backgroundView = UIView()
113113
tableView.backgroundColor = .cyan
114114
}
115-
.introspect(.list, on: .iOS(.v16, .v17, .v18), .visionOS(.v1), scope: .ancestor) { collectionView in
115+
.introspect(.list, on: .iOS(.v16, .v17, .v18), .visionOS(.v1, .v2), scope: .ancestor) { collectionView in
116116
collectionView.backgroundView = UIView()
117117
collectionView.subviews.dropFirst(1).first?.backgroundColor = .cyan
118118
}
@@ -150,7 +150,7 @@ struct ScrollViewShowcase: View {
150150
#if os(iOS) || os(tvOS) || os(visionOS)
151151
.introspect(
152152
.scrollView,
153-
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18), .visionOS(.v1)
153+
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18), .visionOS(.v1, .v2)
154154
) { scrollView in
155155
scrollView.layer.backgroundColor = UIColor.cyan.cgColor
156156
}
@@ -171,7 +171,7 @@ struct ScrollViewShowcase: View {
171171
#if os(iOS) || os(tvOS) || os(visionOS)
172172
.introspect(
173173
.scrollView,
174-
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18), .visionOS(.v1),
174+
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18), .visionOS(.v1, .v2),
175175
scope: .ancestor
176176
) { scrollView in
177177
scrollView.layer.backgroundColor = UIColor.cyan.cgColor
@@ -207,13 +207,13 @@ struct NavigationShowcase: View {
207207
#if os(iOS) || os(tvOS) || os(visionOS)
208208
.introspect(
209209
.navigationView(style: .stack),
210-
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18), .visionOS(.v1)
210+
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18), .visionOS(.v1, .v2)
211211
) { navigationController in
212212
navigationController.navigationBar.backgroundColor = .cyan
213213
}
214214
.introspect(
215215
.navigationView(style: .columns),
216-
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18), .visionOS(.v1)
216+
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18), .visionOS(.v1, .v2)
217217
) { splitViewController in
218218
#if os(visionOS)
219219
splitViewController.preferredDisplayMode = .oneBesideSecondary
@@ -226,7 +226,7 @@ struct NavigationShowcase: View {
226226
}
227227
.introspect(
228228
.searchField,
229-
on: .iOS(.v15, .v16, .v17, .v18), .tvOS(.v15, .v16, .v17, .v18), .visionOS(.v1)
229+
on: .iOS(.v15, .v16, .v17, .v18), .tvOS(.v15, .v16, .v17, .v18), .visionOS(.v1, .v2)
230230
) { searchBar in
231231
searchBar.backgroundColor = .red
232232
#if os(iOS)
@@ -256,7 +256,7 @@ struct PresentationShowcase: View {
256256
presentationController.containerView?.backgroundColor = .red.withAlphaComponent(0.75)
257257
}
258258
#elseif os(visionOS)
259-
.introspect(.sheet, on: .visionOS(.v1)) { sheetPresentationController in
259+
.introspect(.sheet, on: .visionOS(.v1, .v2)) { sheetPresentationController in
260260
sheetPresentationController.containerView?.backgroundColor = .red.withAlphaComponent(0.75)
261261
}
262262
#endif
@@ -269,7 +269,7 @@ struct PresentationShowcase: View {
269269
#if os(iOS) || os(tvOS) || os(visionOS)
270270
.introspect(
271271
.fullScreenCover,
272-
on: .iOS(.v14, .v15, .v16, .v17, .v18), .tvOS(.v14, .v15, .v16, .v17, .v18), .visionOS(.v1)
272+
on: .iOS(.v14, .v15, .v16, .v17, .v18), .tvOS(.v14, .v15, .v16, .v17, .v18), .visionOS(.v1, .v2)
273273
) { presentationController in
274274
presentationController.containerView?.backgroundColor = .red.withAlphaComponent(0.75)
275275
}
@@ -284,7 +284,7 @@ struct PresentationShowcase: View {
284284
.padding()
285285
.introspect(
286286
.popover,
287-
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18), .visionOS(.v1)
287+
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18), .visionOS(.v1, .v2)
288288
) { presentationController in
289289
presentationController.containerView?.backgroundColor = .red.withAlphaComponent(0.75)
290290
}
@@ -305,7 +305,7 @@ struct GenericViewShowcase: View {
305305
#if os(iOS) || os(tvOS) || os(visionOS)
306306
.introspect(
307307
.view,
308-
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18), .visionOS(.v1)
308+
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18), .visionOS(.v1, .v2)
309309
) { view in
310310
view.backgroundColor = .cyan
311311
}
@@ -320,7 +320,7 @@ struct GenericViewShowcase: View {
320320
#if os(iOS) || os(tvOS) || os(visionOS)
321321
.introspect(
322322
.view,
323-
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18), .visionOS(.v1)
323+
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18), .visionOS(.v1, .v2)
324324
) { view in
325325
view.backgroundColor = .lightGray
326326
}
@@ -334,7 +334,7 @@ struct GenericViewShowcase: View {
334334
#if os(iOS) || os(tvOS) || os(visionOS)
335335
.introspect(
336336
.view,
337-
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18), .visionOS(.v1)
337+
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18), .visionOS(.v1, .v2)
338338
) { view in
339339
view.backgroundColor = .blue
340340
}
@@ -348,7 +348,7 @@ struct GenericViewShowcase: View {
348348
#if os(iOS) || os(tvOS) || os(visionOS)
349349
.introspect(
350350
.view,
351-
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18), .visionOS(.v1)
351+
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18), .visionOS(.v1, .v2)
352352
) { view in
353353
view.backgroundColor = .red
354354
}
@@ -375,7 +375,7 @@ struct SimpleElementsShowcase: View {
375375
#if os(iOS) || os(tvOS) || os(visionOS)
376376
.introspect(
377377
.textField,
378-
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18), .visionOS(.v1)
378+
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18), .visionOS(.v1, .v2)
379379
) { textField in
380380
textField.backgroundColor = .red
381381
}
@@ -390,7 +390,7 @@ struct SimpleElementsShowcase: View {
390390
#if os(iOS) || os(tvOS) || os(visionOS)
391391
.introspect(
392392
.textField,
393-
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18), .visionOS(.v1)
393+
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18), .visionOS(.v1, .v2)
394394
) { textField in
395395
textField.backgroundColor = .green
396396
}
@@ -491,7 +491,7 @@ struct SimpleElementsShowcase: View {
491491
Text("DatePicker Red")
492492
}
493493
#if os(iOS) || os(visionOS)
494-
.introspect(.datePicker, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18), .visionOS(.v1)) { datePicker in
494+
.introspect(.datePicker, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18), .visionOS(.v1, .v2)) { datePicker in
495495
datePicker.backgroundColor = .red
496496
}
497497
#elseif os(macOS)
@@ -512,7 +512,7 @@ struct SimpleElementsShowcase: View {
512512
#if os(iOS) || os(tvOS) || os(visionOS)
513513
.introspect(
514514
.picker(style: .segmented),
515-
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18), .visionOS(.v1)
515+
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18), .visionOS(.v1, .v2)
516516
) { datePicker in
517517
datePicker.backgroundColor = .red
518518
}

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ extension iOSViewVersion<TextFieldType, UITextField> {
223223
public static let v15 = Self(for: .v15)
224224
public static let v16 = Self(for: .v16)
225225
public static let v17 = Self(for: .v17)
226+
public static let v18 = Self(for: .v18)
226227
}
227228

228229
extension tvOSViewVersion<TextFieldType, UITextField> {
@@ -231,10 +232,12 @@ extension tvOSViewVersion<TextFieldType, UITextField> {
231232
public static let v15 = Self(for: .v15)
232233
public static let v16 = Self(for: .v16)
233234
public static let v17 = Self(for: .v17)
235+
public static let v18 = Self(for: .v18)
234236
}
235237

236238
extension visionOSViewVersion<TextFieldType, UITextField> {
237239
public static let v1 = Self(for: .v1)
240+
public static let v2 = Self(for: .v2)
238241
}
239242
#elseif canImport(AppKit)
240243
extension macOSViewVersion<TextFieldType, NSTextField> {
@@ -243,6 +246,7 @@ extension macOSViewVersion<TextFieldType, NSTextField> {
243246
public static let v12 = Self(for: .v12)
244247
public static let v13 = Self(for: .v13)
245248
public static let v14 = Self(for: .v14)
249+
public static let v15 = Self(for: .v15)
246250
}
247251
#endif
248252
```

Sources/ViewTypes/ColorPicker.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import SwiftUI
4545
///
4646
/// var body: some View {
4747
/// ColorPicker("Pick a color", selection: $color)
48-
/// .introspect(.colorPicker, on: .visionOS(.v1)) {
48+
/// .introspect(.colorPicker, on: .visionOS(.v1, .v2)) {
4949
/// print(type(of: $0)) // UIColorPicker
5050
/// }
5151
/// }
@@ -73,6 +73,7 @@ extension iOSViewVersion<ColorPickerType, UIColorWell> {
7373
@available(iOS 14, *)
7474
extension visionOSViewVersion<ColorPickerType, UIColorWell> {
7575
public static let v1 = Self(for: .v1)
76+
public static let v2 = Self(for: .v2)
7677
}
7778
#elseif canImport(AppKit)
7879
@available(macOS 11, *)

Sources/ViewTypes/FormWithGroupedStyle.swift

+1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ extension tvOSViewVersion<FormWithGroupedStyleType, UITableView> {
114114

115115
extension visionOSViewVersion<FormWithGroupedStyleType, UICollectionView> {
116116
public static let v1 = Self(for: .v1)
117+
public static let v2 = Self(for: .v2)
117118
}
118119
#elseif canImport(AppKit)
119120
extension macOSViewVersion<FormWithGroupedStyleType, NSScrollView> {

Sources/ViewTypes/SignInWithAppleButton.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ import SwiftUI
6464
/// } onCompletion: { result in
6565
/// // do something with result
6666
/// }
67-
/// .introspect(.signInWithAppleButton, on: .visionOS(.v1)) {
67+
/// .introspect(.signInWithAppleButton, on: .visionOS(.v1, .v2)) {
6868
/// print(type(of: $0)) // ASAuthorizationAppleIDButton
6969
/// }
7070
/// }

Tests/Tests/ViewTypes/ColorPickerTests.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,21 @@ final class ColorPickerTests: XCTestCase {
2727
VStack {
2828
ColorPicker("", selection: .constant(PlatformColor.red.cgColor))
2929
#if os(iOS) || os(visionOS)
30-
.introspect(.colorPicker, on: .iOS(.v14, .v15, .v16, .v17, .v18), .visionOS(.v1), customize: spy0)
30+
.introspect(.colorPicker, on: .iOS(.v14, .v15, .v16, .v17, .v18), .visionOS(.v1, .v2), customize: spy0)
3131
#elseif os(macOS)
3232
.introspect(.colorPicker, on: .macOS(.v11, .v12, .v13, .v14), customize: spy0)
3333
#endif
3434

3535
ColorPicker("", selection: .constant(PlatformColor.green.cgColor))
3636
#if os(iOS) || os(visionOS)
37-
.introspect(.colorPicker, on: .iOS(.v14, .v15, .v16, .v17, .v18), .visionOS(.v1), customize: spy1)
37+
.introspect(.colorPicker, on: .iOS(.v14, .v15, .v16, .v17, .v18), .visionOS(.v1, .v2), customize: spy1)
3838
#elseif os(macOS)
3939
.introspect(.colorPicker, on: .macOS(.v11, .v12, .v13, .v14), customize: spy1)
4040
#endif
4141

4242
ColorPicker("", selection: .constant(PlatformColor.blue.cgColor))
4343
#if os(iOS) || os(visionOS)
44-
.introspect(.colorPicker, on: .iOS(.v14, .v15, .v16, .v17, .v18), .visionOS(.v1), customize: spy2)
44+
.introspect(.colorPicker, on: .iOS(.v14, .v15, .v16, .v17, .v18), .visionOS(.v1, .v2), customize: spy2)
4545
#elseif os(macOS)
4646
.introspect(.colorPicker, on: .macOS(.v11, .v12, .v13, .v14), customize: spy2)
4747
#endif

Tests/Tests/ViewTypes/DatePickerTests.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,23 @@ final class DatePickerTests: XCTestCase {
2424
VStack {
2525
DatePicker("", selection: .constant(date0))
2626
#if os(iOS) || os(visionOS)
27-
.introspect(.datePicker, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18), .visionOS(.v1), customize: spy0)
27+
.introspect(.datePicker, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18), .visionOS(.v1, .v2), customize: spy0)
2828
#elseif os(macOS)
2929
.introspect(.datePicker, on: .macOS(.v10_15, .v11, .v12, .v13, .v14), customize: spy0)
3030
#endif
3131
.cornerRadius(8)
3232

3333
DatePicker("", selection: .constant(date1))
3434
#if os(iOS) || os(visionOS)
35-
.introspect(.datePicker, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18), .visionOS(.v1), customize: spy1)
35+
.introspect(.datePicker, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18), .visionOS(.v1, .v2), customize: spy1)
3636
#elseif os(macOS)
3737
.introspect(.datePicker, on: .macOS(.v10_15, .v11, .v12, .v13, .v14), customize: spy1)
3838
#endif
3939
.cornerRadius(8)
4040

4141
DatePicker("", selection: .constant(date2))
4242
#if os(iOS) || os(visionOS)
43-
.introspect(.datePicker, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18), .visionOS(.v1), customize: spy2)
43+
.introspect(.datePicker, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18), .visionOS(.v1, .v2), customize: spy2)
4444
#elseif os(macOS)
4545
.introspect(.datePicker, on: .macOS(.v10_15, .v11, .v12, .v13, .v14), customize: spy2)
4646
#endif

Tests/Tests/ViewTypes/DatePickerWithCompactFieldStyleTests.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ final class DatePickerWithCompactStyleTests: XCTestCase {
3030
DatePicker("", selection: .constant(date0))
3131
.datePickerStyle(.compact)
3232
#if os(iOS) || os(visionOS)
33-
.introspect(.datePicker(style: .compact), on: .iOS(.v14, .v15, .v16, .v17, .v18), .visionOS(.v1), customize: spy0)
33+
.introspect(.datePicker(style: .compact), on: .iOS(.v14, .v15, .v16, .v17, .v18), .visionOS(.v1, .v2), customize: spy0)
3434
#elseif os(macOS)
3535
.introspect(.datePicker(style: .compact), on: .macOS(.v10_15_4, .v11, .v12, .v13, .v14), customize: spy0)
3636
#endif
@@ -39,7 +39,7 @@ final class DatePickerWithCompactStyleTests: XCTestCase {
3939
DatePicker("", selection: .constant(date1))
4040
.datePickerStyle(.compact)
4141
#if os(iOS) || os(visionOS)
42-
.introspect(.datePicker(style: .compact), on: .iOS(.v14, .v15, .v16, .v17, .v18), .visionOS(.v1), customize: spy1)
42+
.introspect(.datePicker(style: .compact), on: .iOS(.v14, .v15, .v16, .v17, .v18), .visionOS(.v1, .v2), customize: spy1)
4343
#elseif os(macOS)
4444
.introspect(.datePicker(style: .compact), on: .macOS(.v10_15_4, .v11, .v12, .v13, .v14), customize: spy1)
4545
#endif
@@ -48,7 +48,7 @@ final class DatePickerWithCompactStyleTests: XCTestCase {
4848
DatePicker("", selection: .constant(date2))
4949
.datePickerStyle(.compact)
5050
#if os(iOS) || os(visionOS)
51-
.introspect(.datePicker(style: .compact), on: .iOS(.v14, .v15, .v16, .v17, .v18), .visionOS(.v1), customize: spy2)
51+
.introspect(.datePicker(style: .compact), on: .iOS(.v14, .v15, .v16, .v17, .v18), .visionOS(.v1, .v2), customize: spy2)
5252
#elseif os(macOS)
5353
.introspect(.datePicker(style: .compact), on: .macOS(.v10_15_4, .v11, .v12, .v13, .v14), customize: spy2)
5454
#endif

0 commit comments

Comments
 (0)