Skip to content

Commit 6ecd8d9

Browse files
authored
Support 2026 beta 1 platforms (#458)
1 parent 4cea34c commit 6ecd8d9

File tree

108 files changed

+807
-482
lines changed

Some content is hidden

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

108 files changed

+807
-482
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ jobs:
6262
runtime: iOS 18.2
6363
os: macos-14
6464
xcode: 16.2
65+
# - platform: [iOS, 26]
66+
# runtime: iOS 26.0
67+
# os: macos-15
68+
# xcode: 26.0
6569

6670
- platform: [tvOS, 15]
6771
runtime: tvOS 15.4
@@ -80,6 +84,10 @@ jobs:
8084
runtime: tvOS 18.2
8185
os: macos-14
8286
xcode: 16.2
87+
# - platform: [tvOS, 26]
88+
# runtime: tvOS 26.0
89+
# os: macos-15
90+
# xcode: 26.0
8391

8492
- platform: [watchOS, 8]
8593
runtime: watchOS 8.5
@@ -98,6 +106,10 @@ jobs:
98106
runtime: watchOS 11.2
99107
os: macos-14
100108
xcode: 16.2
109+
# - platform: [watchOS, 26]
110+
# runtime: watchOS 26.0
111+
# os: macos-15
112+
# xcode: 26.0
101113

102114
- platform: [macOS, 13]
103115
runtime: macOS 13
@@ -111,6 +123,10 @@ jobs:
111123
runtime: macOS 15
112124
os: macos-15
113125
xcode: 16.2
126+
# - platform: [macOS, 26]
127+
# runtime: macOS 26.0
128+
# os: macos-15
129+
# xcode: 26.0
114130

115131
- platform: [visionOS, 1]
116132
runtime: visionOS 1.2
@@ -120,6 +136,10 @@ jobs:
120136
runtime: visionOS 2.5
121137
os: macos-15
122138
xcode: 16.4
139+
# - platform: [visionOS, 26]
140+
# runtime: visionOS 26.0
141+
# os: macos-15
142+
# xcode: 26.0
123143
steps:
124144
- name: Git Checkout
125145
uses: actions/checkout@v4

Examples/Showcase/Showcase/AppView.swift

Lines changed: 49 additions & 49 deletions
Large diffs are not rendered by default.

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/PlatformVersion.swift

Lines changed: 59 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,20 @@ extension iOSVersion {
122122
return nil
123123
#endif
124124
}
125+
126+
public static let v26 = iOSVersion {
127+
#if os(iOS)
128+
if #available(iOS 27, *) {
129+
return .past
130+
}
131+
if #available(iOS 26, *) {
132+
return .current
133+
}
134+
return .future
135+
#else
136+
return nil
137+
#endif
138+
}
125139
}
126140

127141
public struct tvOSVersion: PlatformVersion {
@@ -192,17 +206,17 @@ extension tvOSVersion {
192206
}
193207

194208
public static let v17 = tvOSVersion {
195-
#if os(tvOS)
209+
#if os(tvOS)
196210
if #available(tvOS 18, *) {
197211
return .past
198212
}
199213
if #available(tvOS 17, *) {
200214
return .current
201215
}
202216
return .future
203-
#else
217+
#else
204218
return nil
205-
#endif
219+
#endif
206220
}
207221

208222
public static let v18 = tvOSVersion {
@@ -218,6 +232,20 @@ extension tvOSVersion {
218232
return nil
219233
#endif
220234
}
235+
236+
public static let v26 = tvOSVersion {
237+
#if os(tvOS)
238+
if #available(tvOS 27, *) {
239+
return .past
240+
}
241+
if #available(tvOS 26, *) {
242+
return .current
243+
}
244+
return .future
245+
#else
246+
return nil
247+
#endif
248+
}
221249
}
222250

223251
public struct macOSVersion: PlatformVersion {
@@ -328,6 +356,20 @@ extension macOSVersion {
328356
return nil
329357
#endif
330358
}
359+
360+
public static let v26 = macOSVersion {
361+
#if os(macOS)
362+
if #available(macOS 27, *) {
363+
return .past
364+
}
365+
if #available(macOS 26, *) {
366+
return .current
367+
}
368+
return .future
369+
#else
370+
return nil
371+
#endif
372+
}
331373
}
332374

333375
public struct visionOSVersion: PlatformVersion {
@@ -368,5 +410,19 @@ extension visionOSVersion {
368410
return nil
369411
#endif
370412
}
413+
414+
public static let v26 = visionOSVersion {
415+
#if os(visionOS)
416+
if #available(visionOS 27, *) {
417+
return .past
418+
}
419+
if #available(visionOS 26, *) {
420+
return .current
421+
}
422+
return .future
423+
#else
424+
return nil
425+
#endif
426+
}
371427
}
372428
#endif

Sources/ViewTypes/Button.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import SwiftUI
1717
/// struct ContentView: View {
1818
/// var body: some View {
1919
/// Button("Action", action: {})
20-
/// .introspect(.button, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15)) {
20+
/// .introspect(.button, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26)) {
2121
/// print(type(of: $0)) // NSButton
2222
/// }
2323
/// }
@@ -42,6 +42,7 @@ extension macOSViewVersion<ButtonType, NSButton> {
4242
public static let v13 = Self(for: .v13)
4343
public static let v14 = Self(for: .v14)
4444
public static let v15 = Self(for: .v15)
45+
public static let v26 = Self(for: .v26)
4546
}
4647
#endif
4748
#endif

Sources/ViewTypes/ColorPicker.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import SwiftUI
1111
///
1212
/// var body: some View {
1313
/// ColorPicker("Pick a color", selection: $color)
14-
/// .introspect(.colorPicker, on: .iOS(.v14, .v15, .v16, .v17, .v18)) {
14+
/// .introspect(.colorPicker, on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26)) {
1515
/// print(type(of: $0)) // UIColorPicker
1616
/// }
1717
/// }
@@ -30,7 +30,7 @@ import SwiftUI
3030
///
3131
/// var body: some View {
3232
/// ColorPicker("Pick a color", selection: $color)
33-
/// .introspect(.colorPicker, on: .macOS(.v11, .v12, .v13, .v14, .v15)) {
33+
/// .introspect(.colorPicker, on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26)) {
3434
/// print(type(of: $0)) // NSColorPicker
3535
/// }
3636
/// }
@@ -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, .v2)) {
48+
/// .introspect(.colorPicker, on: .visionOS(.v1, .v2, .v26)) {
4949
/// print(type(of: $0)) // UIColorPicker
5050
/// }
5151
/// }
@@ -68,12 +68,14 @@ extension iOSViewVersion<ColorPickerType, UIColorWell> {
6868
public static let v16 = Self(for: .v16)
6969
public static let v17 = Self(for: .v17)
7070
public static let v18 = Self(for: .v18)
71+
public static let v26 = Self(for: .v26)
7172
}
7273

7374
@available(iOS 14, *)
7475
extension visionOSViewVersion<ColorPickerType, UIColorWell> {
7576
public static let v1 = Self(for: .v1)
7677
public static let v2 = Self(for: .v2)
78+
public static let v26 = Self(for: .v26)
7779
}
7880
#elseif canImport(AppKit)
7981
@available(macOS 11, *)
@@ -85,6 +87,7 @@ extension macOSViewVersion<ColorPickerType, NSColorWell> {
8587
public static let v13 = Self(for: .v13)
8688
public static let v14 = Self(for: .v14)
8789
public static let v15 = Self(for: .v15)
90+
public static let v26 = Self(for: .v26)
8891
}
8992
#endif
9093
#endif

Sources/ViewTypes/DatePicker.swift

Lines changed: 6 additions & 3 deletions
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
/// }
@@ -28,7 +28,7 @@ import SwiftUI
2828
///
2929
/// var body: some View {
3030
/// DatePicker("Pick a date", selection: $date)
31-
/// .introspect(.datePicker, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15)) {
31+
/// .introspect(.datePicker, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26)) {
3232
/// print(type(of: $0)) // NSDatePicker
3333
/// }
3434
/// }
@@ -43,7 +43,7 @@ import SwiftUI
4343
///
4444
/// var body: some View {
4545
/// DatePicker("Pick a date", selection: $date)
46-
/// .introspect(.datePicker, on: .visionOS(.v1, .v2)) {
46+
/// .introspect(.datePicker, on: .visionOS(.v1, .v2, .v26)) {
4747
/// print(type(of: $0)) // UIDatePicker
4848
/// }
4949
/// }
@@ -64,11 +64,13 @@ 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> {
7071
public static let v1 = Self(for: .v1)
7172
public static let v2 = Self(for: .v2)
73+
public static let v26 = Self(for: .v26)
7274
}
7375
#elseif canImport(AppKit)
7476
extension macOSViewVersion<DatePickerType, NSDatePicker> {
@@ -78,6 +80,7 @@ extension macOSViewVersion<DatePickerType, NSDatePicker> {
7880
public static let v13 = Self(for: .v13)
7981
public static let v14 = Self(for: .v14)
8082
public static let v15 = Self(for: .v15)
83+
public static let v26 = Self(for: .v26)
8184
}
8285
#endif
8386
#endif

Sources/ViewTypes/DatePickerWithCompactStyle.swift

Lines changed: 6 additions & 3 deletions
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
/// }
@@ -32,7 +32,7 @@ import SwiftUI
3232
/// var body: some View {
3333
/// DatePicker("Pick a date", selection: $date)
3434
/// .datePickerStyle(.compact)
35-
/// .introspect(.datePicker(style: .compact), on: .macOS(.v10_15_4, .v11, .v12, .v13, .v14, .v15)) {
35+
/// .introspect(.datePicker(style: .compact), on: .macOS(.v10_15_4, .v11, .v12, .v13, .v14, .v15, .v26)) {
3636
/// print(type(of: $0)) // NSDatePicker
3737
/// }
3838
/// }
@@ -48,7 +48,7 @@ import SwiftUI
4848
/// var body: some View {
4949
/// DatePicker("Pick a date", selection: $date)
5050
/// .datePickerStyle(.compact)
51-
/// .introspect(.datePicker(style: .compact), on: .visionOS(.v1, .v2)) {
51+
/// .introspect(.datePicker(style: .compact), on: .visionOS(.v1, .v2, .v26)) {
5252
/// print(type(of: $0)) // UIDatePicker
5353
/// }
5454
/// }
@@ -74,11 +74,13 @@ 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> {
8081
public static let v1 = Self(for: .v1)
8182
public static let v2 = Self(for: .v2)
83+
public static let v26 = Self(for: .v26)
8284
}
8385
#elseif canImport(AppKit) && !targetEnvironment(macCatalyst)
8486
extension macOSViewVersion<DatePickerWithCompactStyleType, NSDatePicker> {
@@ -90,6 +92,7 @@ extension macOSViewVersion<DatePickerWithCompactStyleType, NSDatePicker> {
9092
public static let v13 = Self(for: .v13)
9193
public static let v14 = Self(for: .v14)
9294
public static let v15 = Self(for: .v15)
95+
public static let v26 = Self(for: .v26)
9396
}
9497
#endif
9598
#endif

0 commit comments

Comments
 (0)