Skip to content

Commit 79f9f39

Browse files
committed
WIP
1 parent 2a650f8 commit 79f9f39

File tree

90 files changed

+333
-261
lines changed

Some content is hidden

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

90 files changed

+333
-261
lines changed

Examples/Showcase/Showcase/AppView.swift

Lines changed: 29 additions & 29 deletions
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, .v2)
10+
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2)
1111
) { window in
1212
window.backgroundColor = .brown
1313
}
@@ -46,7 +46,7 @@ struct ContentView: View {
4646
.tag(5)
4747
}
4848
#if os(iOS) || os(tvOS)
49-
.introspect(.tabView, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18)) { tabBarController in
49+
.introspect(.tabView, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) { tabBarController in
5050
tabBarController.tabBar.layer.backgroundColor = UIColor.green.cgColor
5151
}
5252
#elseif os(macOS)
@@ -83,11 +83,11 @@ struct ListShowcase: View {
8383
Text("Item 2")
8484
}
8585
#if os(iOS) || os(tvOS) || os(visionOS)
86-
.introspect(.list, on: .iOS(.v13, .v14, .v15), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18)) { tableView in
86+
.introspect(.list, on: .iOS(.v13, .v14, .v15), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) { tableView in
8787
tableView.backgroundView = UIView()
8888
tableView.backgroundColor = .cyan
8989
}
90-
.introspect(.list, on: .iOS(.v16, .v17, .v18), .visionOS(.v1, .v2)) { collectionView in
90+
.introspect(.list, on: .iOS(.v16, .v17, .v18, .v26), .visionOS(.v1, .v2)) { collectionView in
9191
collectionView.backgroundView = UIView()
9292
collectionView.subviews.dropFirst(1).first?.backgroundColor = .cyan
9393
}
@@ -108,11 +108,11 @@ struct ListShowcase: View {
108108
Text("Item 1")
109109
Text("Item 2")
110110
#if os(iOS) || os(tvOS) || os(visionOS)
111-
.introspect(.list, on: .iOS(.v13, .v14, .v15), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18), scope: .ancestor) { tableView in
111+
.introspect(.list, on: .iOS(.v13, .v14, .v15), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), scope: .ancestor) { tableView in
112112
tableView.backgroundView = UIView()
113113
tableView.backgroundColor = .cyan
114114
}
115-
.introspect(.list, on: .iOS(.v16, .v17, .v18), .visionOS(.v1, .v2), scope: .ancestor) { collectionView in
115+
.introspect(.list, on: .iOS(.v16, .v17, .v18, .v26), .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, .v2)
153+
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .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, .v2),
174+
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2),
175175
scope: .ancestor
176176
) { scrollView in
177177
scrollView.layer.backgroundColor = UIColor.cyan.cgColor
@@ -207,26 +207,26 @@ 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, .v2)
210+
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .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, .v2)
216+
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2)
217217
) { splitViewController in
218218
#if os(visionOS)
219219
splitViewController.preferredDisplayMode = .oneBesideSecondary
220220
#else
221221
splitViewController.preferredDisplayMode = .oneOverSecondary
222222
#endif
223223
}
224-
.introspect(.navigationView(style: .columns), on: .tvOS(.v13, .v14, .v15, .v16, .v17, .v18)) { navigationController in
224+
.introspect(.navigationView(style: .columns), on: .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) { navigationController in
225225
navigationController.navigationBar.backgroundColor = .cyan
226226
}
227227
.introspect(
228228
.searchField,
229-
on: .iOS(.v15, .v16, .v17, .v18), .tvOS(.v15, .v16, .v17, .v18), .visionOS(.v1, .v2)
229+
on: .iOS(.v15, .v16, .v17, .v18, .v26), .tvOS(.v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2)
230230
) { searchBar in
231231
searchBar.backgroundColor = .red
232232
#if os(iOS)
@@ -251,7 +251,7 @@ struct PresentationShowcase: View {
251251
#if os(iOS) || os(tvOS)
252252
.introspect(
253253
.sheet,
254-
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18)
254+
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)
255255
) { presentationController in
256256
presentationController.containerView?.backgroundColor = .red.withAlphaComponent(0.75)
257257
}
@@ -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, .v2)
272+
on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v14, .v15, .v16, .v17, .v18, .v26), .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, .v2)
287+
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .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, .v2)
308+
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .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, .v2)
323+
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2)
324324
) { view in
325325
view.backgroundColor = .yellow
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, .v2)
337+
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .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, .v2)
351+
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .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, .v2)
378+
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .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, .v2)
393+
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2)
394394
) { textField in
395395
textField.backgroundColor = .green
396396
}
@@ -408,7 +408,7 @@ struct SimpleElementsShowcase: View {
408408
#if os(iOS)
409409
.introspect(
410410
.toggle,
411-
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18)
411+
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)
412412
) { toggle in
413413
toggle.backgroundColor = .red
414414
}
@@ -422,7 +422,7 @@ struct SimpleElementsShowcase: View {
422422
#if os(iOS)
423423
.introspect(
424424
.toggle,
425-
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18)
425+
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)
426426
) { toggle in
427427
toggle.backgroundColor = .green
428428
}
@@ -436,7 +436,7 @@ struct SimpleElementsShowcase: View {
436436
HStack {
437437
Slider(value: $sliderValue, in: 0...100)
438438
#if os(iOS)
439-
.introspect(.slider, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18)) { slider in
439+
.introspect(.slider, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) { slider in
440440
slider.backgroundColor = .red
441441
}
442442
#elseif os(macOS)
@@ -447,7 +447,7 @@ struct SimpleElementsShowcase: View {
447447

448448
Slider(value: $sliderValue, in: 0...100)
449449
#if os(iOS)
450-
.introspect(.slider, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18)) { slider in
450+
.introspect(.slider, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) { slider in
451451
slider.backgroundColor = .green
452452
}
453453
#elseif os(macOS)
@@ -462,7 +462,7 @@ struct SimpleElementsShowcase: View {
462462
Text("Stepper Red")
463463
}
464464
#if os(iOS)
465-
.introspect(.stepper, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18)) { stepper in
465+
.introspect(.stepper, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) { stepper in
466466
stepper.backgroundColor = .red
467467
}
468468
#elseif os(macOS)
@@ -475,7 +475,7 @@ struct SimpleElementsShowcase: View {
475475
Text("Stepper Green")
476476
}
477477
#if os(iOS)
478-
.introspect(.stepper, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18)) { stepper in
478+
.introspect(.stepper, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) { stepper in
479479
stepper.backgroundColor = .green
480480
}
481481
#elseif os(macOS)
@@ -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, .v2)) { datePicker in
494+
.introspect(.datePicker, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .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, .v2)
515+
on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .tvOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), .visionOS(.v1, .v2)
516516
) { datePicker in
517517
datePicker.backgroundColor = .red
518518
}

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ For instance, when introspecting a `ScrollView`...
2020
ScrollView {
2121
Text("Item 1")
2222
}
23-
.introspect(.scrollView, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18)) { scrollView in
23+
.introspect(.scrollView, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) { scrollView in
2424
// do something with UIScrollView
2525
}
2626
```
@@ -38,7 +38,7 @@ By default, the `.introspect` modifier acts directly on its _receiver_. This mea
3838
```swift
3939
ScrollView {
4040
Text("Item 1")
41-
.introspect(.scrollView, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18), scope: .ancestor) { scrollView in
41+
.introspect(.scrollView, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), scope: .ancestor) { scrollView in
4242
// do something with UIScrollView
4343
}
4444
}
@@ -157,7 +157,7 @@ List {
157157
tableView.backgroundView = UIView()
158158
tableView.backgroundColor = .cyan
159159
}
160-
.introspect(.list, on: .iOS(.v16, .v17, .v18)) { collectionView in
160+
.introspect(.list, on: .iOS(.v16, .v17, .v18, .v26)) { collectionView in
161161
collectionView.backgroundView = UIView()
162162
collectionView.subviews.dropFirst(1).first?.backgroundColor = .cyan
163163
}
@@ -169,7 +169,7 @@ List {
169169
ScrollView {
170170
Text("Item")
171171
}
172-
.introspect(.scrollView, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18)) { scrollView in
172+
.introspect(.scrollView, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) { scrollView in
173173
scrollView.backgroundColor = .red
174174
}
175175
```
@@ -181,7 +181,7 @@ NavigationView {
181181
Text("Item")
182182
}
183183
.navigationViewStyle(.stack)
184-
.introspect(.navigationView(style: .stack), on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18)) { navigationController in
184+
.introspect(.navigationView(style: .stack), on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) { navigationController in
185185
navigationController.navigationBar.backgroundColor = .cyan
186186
}
187187
```
@@ -190,7 +190,7 @@ NavigationView {
190190

191191
```swift
192192
TextField("Text Field", text: <#Binding<String>#>)
193-
.introspect(.textField, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18)) { textField in
193+
.introspect(.textField, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) { textField in
194194
textField.backgroundColor = .red
195195
}
196196
```
@@ -290,7 +290,7 @@ struct ContentView: View {
290290
ScrollView {
291291
// ...
292292
}
293-
.introspect(.scrollView, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18)) { scrollView in
293+
.introspect(.scrollView, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) { scrollView in
294294
self.scrollView = scrollView
295295
}
296296
}

Sources/Introspect.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ extension View {
3434
///
3535
/// var body: some View {
3636
/// TextField("Placeholder", text: $text)
37-
/// .introspect(.textField, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18)) {
37+
/// .introspect(.textField, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) {
3838
/// print(type(of: $0)) // UITextField
3939
/// }
4040
/// }

Sources/ViewTypes/DatePicker.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import SwiftUI
1111
///
1212
/// var body: some View {
1313
/// DatePicker("Pick a date", selection: $date)
14-
/// .introspect(.datePicker, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18)) {
14+
/// .introspect(.datePicker, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) {
1515
/// print(type(of: $0)) // UIDatePicker
1616
/// }
1717
/// }
@@ -64,6 +64,7 @@ extension iOSViewVersion<DatePickerType, UIDatePicker> {
6464
public static let v16 = Self(for: .v16)
6565
public static let v17 = Self(for: .v17)
6666
public static let v18 = Self(for: .v18)
67+
public static let v26 = Self(for: .v26)
6768
}
6869

6970
extension visionOSViewVersion<DatePickerType, UIDatePicker> {

Sources/ViewTypes/DatePickerWithCompactStyle.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import SwiftUI
1212
/// var body: some View {
1313
/// DatePicker("Pick a date", selection: $date)
1414
/// .datePickerStyle(.compact)
15-
/// .introspect(.datePicker(style: .compact), on: .iOS(.v14, .v15, .v16, .v17, .v18)) {
15+
/// .introspect(.datePicker(style: .compact), on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26)) {
1616
/// print(type(of: $0)) // UIDatePicker
1717
/// }
1818
/// }
@@ -74,6 +74,7 @@ extension iOSViewVersion<DatePickerWithCompactStyleType, UIDatePicker> {
7474
public static let v16 = Self(for: .v16)
7575
public static let v17 = Self(for: .v17)
7676
public static let v18 = Self(for: .v18)
77+
public static let v26 = Self(for: .v26)
7778
}
7879

7980
extension visionOSViewVersion<DatePickerWithCompactStyleType, UIDatePicker> {

Sources/ViewTypes/DatePickerWithGraphicalStyle.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import SwiftUI
1212
/// var body: some View {
1313
/// DatePicker("Pick a date", selection: $date)
1414
/// .datePickerStyle(.graphical)
15-
/// .introspect(.datePicker(style: .graphical), on: .iOS(.v14, .v15, .v16, .v17, .v18)) {
15+
/// .introspect(.datePicker(style: .graphical), on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26)) {
1616
/// print(type(of: $0)) // UIDatePicker
1717
/// }
1818
/// }
@@ -74,6 +74,7 @@ extension iOSViewVersion<DatePickerWithGraphicalStyleType, UIDatePicker> {
7474
public static let v16 = Self(for: .v16)
7575
public static let v17 = Self(for: .v17)
7676
public static let v18 = Self(for: .v18)
77+
public static let v26 = Self(for: .v26)
7778
}
7879

7980
extension visionOSViewVersion<DatePickerWithGraphicalStyleType, UIDatePicker> {

0 commit comments

Comments
 (0)