Skip to content

Support 2026 beta 1 platforms #458

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

Merged
merged 12 commits into from
Jun 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ jobs:
runtime: iOS 18.2
os: macos-14
xcode: 16.2
# - platform: [iOS, 26]
# runtime: iOS 26.0
# os: macos-15
# xcode: 26.0

- platform: [tvOS, 15]
runtime: tvOS 15.4
Expand All @@ -80,6 +84,10 @@ jobs:
runtime: tvOS 18.2
os: macos-14
xcode: 16.2
# - platform: [tvOS, 26]
# runtime: tvOS 26.0
# os: macos-15
# xcode: 26.0

- platform: [watchOS, 8]
runtime: watchOS 8.5
Expand All @@ -98,6 +106,10 @@ jobs:
runtime: watchOS 11.2
os: macos-14
xcode: 16.2
# - platform: [watchOS, 26]
# runtime: watchOS 26.0
# os: macos-15
# xcode: 26.0

- platform: [macOS, 13]
runtime: macOS 13
Expand All @@ -111,6 +123,10 @@ jobs:
runtime: macOS 15
os: macos-15
xcode: 16.2
# - platform: [macOS, 26]
# runtime: macOS 26.0
# os: macos-15
# xcode: 26.0

- platform: [visionOS, 1]
runtime: visionOS 1.2
Expand All @@ -120,6 +136,10 @@ jobs:
runtime: visionOS 2.5
os: macos-15
xcode: 16.4
# - platform: [visionOS, 26]
# runtime: visionOS 26.0
# os: macos-15
# xcode: 26.0
steps:
- name: Git Checkout
uses: actions/checkout@v4
Expand Down
98 changes: 49 additions & 49 deletions Examples/Showcase/Showcase/AppView.swift

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ For instance, when introspecting a `ScrollView`...
ScrollView {
Text("Item 1")
}
.introspect(.scrollView, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18)) { scrollView in
.introspect(.scrollView, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) { scrollView in
// do something with UIScrollView
}
```
Expand All @@ -38,7 +38,7 @@ By default, the `.introspect` modifier acts directly on its _receiver_. This mea
```swift
ScrollView {
Text("Item 1")
.introspect(.scrollView, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18), scope: .ancestor) { scrollView in
.introspect(.scrollView, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), scope: .ancestor) { scrollView in
// do something with UIScrollView
}
}
Expand Down Expand Up @@ -157,7 +157,7 @@ List {
tableView.backgroundView = UIView()
tableView.backgroundColor = .cyan
}
.introspect(.list, on: .iOS(.v16, .v17, .v18)) { collectionView in
.introspect(.list, on: .iOS(.v16, .v17, .v18, .v26)) { collectionView in
collectionView.backgroundView = UIView()
collectionView.subviews.dropFirst(1).first?.backgroundColor = .cyan
}
Expand All @@ -169,7 +169,7 @@ List {
ScrollView {
Text("Item")
}
.introspect(.scrollView, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18)) { scrollView in
.introspect(.scrollView, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) { scrollView in
scrollView.backgroundColor = .red
}
```
Expand All @@ -181,7 +181,7 @@ NavigationView {
Text("Item")
}
.navigationViewStyle(.stack)
.introspect(.navigationView(style: .stack), on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18)) { navigationController in
.introspect(.navigationView(style: .stack), on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) { navigationController in
navigationController.navigationBar.backgroundColor = .cyan
}
```
Expand All @@ -190,7 +190,7 @@ NavigationView {

```swift
TextField("Text Field", text: <#Binding<String>#>)
.introspect(.textField, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18)) { textField in
.introspect(.textField, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) { textField in
textField.backgroundColor = .red
}
```
Expand Down Expand Up @@ -290,7 +290,7 @@ struct ContentView: View {
ScrollView {
// ...
}
.introspect(.scrollView, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18)) { scrollView in
.introspect(.scrollView, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) { scrollView in
self.scrollView = scrollView
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/Introspect.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ extension View {
///
/// var body: some View {
/// TextField("Placeholder", text: $text)
/// .introspect(.textField, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18)) {
/// .introspect(.textField, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) {
/// print(type(of: $0)) // UITextField
/// }
/// }
Expand Down
62 changes: 59 additions & 3 deletions Sources/PlatformVersion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,20 @@ extension iOSVersion {
return nil
#endif
}

public static let v26 = iOSVersion {
#if os(iOS)
if #available(iOS 27, *) {
return .past
}
if #available(iOS 26, *) {
return .current
}
return .future
#else
return nil
#endif
}
}

public struct tvOSVersion: PlatformVersion {
Expand Down Expand Up @@ -192,17 +206,17 @@ extension tvOSVersion {
}

public static let v17 = tvOSVersion {
#if os(tvOS)
#if os(tvOS)
if #available(tvOS 18, *) {
return .past
}
if #available(tvOS 17, *) {
return .current
}
return .future
#else
#else
return nil
#endif
#endif
}

public static let v18 = tvOSVersion {
Expand All @@ -218,6 +232,20 @@ extension tvOSVersion {
return nil
#endif
}

public static let v26 = tvOSVersion {
#if os(tvOS)
if #available(tvOS 27, *) {
return .past
}
if #available(tvOS 26, *) {
return .current
}
return .future
#else
return nil
#endif
}
}

public struct macOSVersion: PlatformVersion {
Expand Down Expand Up @@ -328,6 +356,20 @@ extension macOSVersion {
return nil
#endif
}

public static let v26 = macOSVersion {
#if os(macOS)
if #available(macOS 27, *) {
return .past
}
if #available(macOS 26, *) {
return .current
}
return .future
#else
return nil
#endif
}
}

public struct visionOSVersion: PlatformVersion {
Expand Down Expand Up @@ -368,5 +410,19 @@ extension visionOSVersion {
return nil
#endif
}

public static let v26 = visionOSVersion {
#if os(visionOS)
if #available(visionOS 27, *) {
return .past
}
if #available(visionOS 26, *) {
return .current
}
return .future
#else
return nil
#endif
}
}
#endif
3 changes: 2 additions & 1 deletion Sources/ViewTypes/Button.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import SwiftUI
/// struct ContentView: View {
/// var body: some View {
/// Button("Action", action: {})
/// .introspect(.button, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15)) {
/// .introspect(.button, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26)) {
/// print(type(of: $0)) // NSButton
/// }
/// }
Expand All @@ -42,6 +42,7 @@ extension macOSViewVersion<ButtonType, NSButton> {
public static let v13 = Self(for: .v13)
public static let v14 = Self(for: .v14)
public static let v15 = Self(for: .v15)
public static let v26 = Self(for: .v26)
}
#endif
#endif
Expand Down
9 changes: 6 additions & 3 deletions Sources/ViewTypes/ColorPicker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import SwiftUI
///
/// var body: some View {
/// ColorPicker("Pick a color", selection: $color)
/// .introspect(.colorPicker, on: .iOS(.v14, .v15, .v16, .v17, .v18)) {
/// .introspect(.colorPicker, on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26)) {
/// print(type(of: $0)) // UIColorPicker
/// }
/// }
Expand All @@ -30,7 +30,7 @@ import SwiftUI
///
/// var body: some View {
/// ColorPicker("Pick a color", selection: $color)
/// .introspect(.colorPicker, on: .macOS(.v11, .v12, .v13, .v14, .v15)) {
/// .introspect(.colorPicker, on: .macOS(.v11, .v12, .v13, .v14, .v15, .v26)) {
/// print(type(of: $0)) // NSColorPicker
/// }
/// }
Expand All @@ -45,7 +45,7 @@ import SwiftUI
///
/// var body: some View {
/// ColorPicker("Pick a color", selection: $color)
/// .introspect(.colorPicker, on: .visionOS(.v1, .v2)) {
/// .introspect(.colorPicker, on: .visionOS(.v1, .v2, .v26)) {
/// print(type(of: $0)) // UIColorPicker
/// }
/// }
Expand All @@ -68,12 +68,14 @@ extension iOSViewVersion<ColorPickerType, UIColorWell> {
public static let v16 = Self(for: .v16)
public static let v17 = Self(for: .v17)
public static let v18 = Self(for: .v18)
public static let v26 = Self(for: .v26)
}

@available(iOS 14, *)
extension visionOSViewVersion<ColorPickerType, UIColorWell> {
public static let v1 = Self(for: .v1)
public static let v2 = Self(for: .v2)
public static let v26 = Self(for: .v26)
}
#elseif canImport(AppKit)
@available(macOS 11, *)
Expand All @@ -85,6 +87,7 @@ extension macOSViewVersion<ColorPickerType, NSColorWell> {
public static let v13 = Self(for: .v13)
public static let v14 = Self(for: .v14)
public static let v15 = Self(for: .v15)
public static let v26 = Self(for: .v26)
}
#endif
#endif
Expand Down
9 changes: 6 additions & 3 deletions Sources/ViewTypes/DatePicker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import SwiftUI
///
/// var body: some View {
/// DatePicker("Pick a date", selection: $date)
/// .introspect(.datePicker, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18)) {
/// .introspect(.datePicker, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26)) {
/// print(type(of: $0)) // UIDatePicker
/// }
/// }
Expand All @@ -28,7 +28,7 @@ import SwiftUI
///
/// var body: some View {
/// DatePicker("Pick a date", selection: $date)
/// .introspect(.datePicker, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15)) {
/// .introspect(.datePicker, on: .macOS(.v10_15, .v11, .v12, .v13, .v14, .v15, .v26)) {
/// print(type(of: $0)) // NSDatePicker
/// }
/// }
Expand All @@ -43,7 +43,7 @@ import SwiftUI
///
/// var body: some View {
/// DatePicker("Pick a date", selection: $date)
/// .introspect(.datePicker, on: .visionOS(.v1, .v2)) {
/// .introspect(.datePicker, on: .visionOS(.v1, .v2, .v26)) {
/// print(type(of: $0)) // UIDatePicker
/// }
/// }
Expand All @@ -64,11 +64,13 @@ extension iOSViewVersion<DatePickerType, UIDatePicker> {
public static let v16 = Self(for: .v16)
public static let v17 = Self(for: .v17)
public static let v18 = Self(for: .v18)
public static let v26 = Self(for: .v26)
}

extension visionOSViewVersion<DatePickerType, UIDatePicker> {
public static let v1 = Self(for: .v1)
public static let v2 = Self(for: .v2)
public static let v26 = Self(for: .v26)
}
#elseif canImport(AppKit)
extension macOSViewVersion<DatePickerType, NSDatePicker> {
Expand All @@ -78,6 +80,7 @@ extension macOSViewVersion<DatePickerType, NSDatePicker> {
public static let v13 = Self(for: .v13)
public static let v14 = Self(for: .v14)
public static let v15 = Self(for: .v15)
public static let v26 = Self(for: .v26)
}
#endif
#endif
Expand Down
9 changes: 6 additions & 3 deletions Sources/ViewTypes/DatePickerWithCompactStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import SwiftUI
/// var body: some View {
/// DatePicker("Pick a date", selection: $date)
/// .datePickerStyle(.compact)
/// .introspect(.datePicker(style: .compact), on: .iOS(.v14, .v15, .v16, .v17, .v18)) {
/// .introspect(.datePicker(style: .compact), on: .iOS(.v14, .v15, .v16, .v17, .v18, .v26)) {
/// print(type(of: $0)) // UIDatePicker
/// }
/// }
Expand All @@ -32,7 +32,7 @@ import SwiftUI
/// var body: some View {
/// DatePicker("Pick a date", selection: $date)
/// .datePickerStyle(.compact)
/// .introspect(.datePicker(style: .compact), on: .macOS(.v10_15_4, .v11, .v12, .v13, .v14, .v15)) {
/// .introspect(.datePicker(style: .compact), on: .macOS(.v10_15_4, .v11, .v12, .v13, .v14, .v15, .v26)) {
/// print(type(of: $0)) // NSDatePicker
/// }
/// }
Expand All @@ -48,7 +48,7 @@ import SwiftUI
/// var body: some View {
/// DatePicker("Pick a date", selection: $date)
/// .datePickerStyle(.compact)
/// .introspect(.datePicker(style: .compact), on: .visionOS(.v1, .v2)) {
/// .introspect(.datePicker(style: .compact), on: .visionOS(.v1, .v2, .v26)) {
/// print(type(of: $0)) // UIDatePicker
/// }
/// }
Expand All @@ -74,11 +74,13 @@ extension iOSViewVersion<DatePickerWithCompactStyleType, UIDatePicker> {
public static let v16 = Self(for: .v16)
public static let v17 = Self(for: .v17)
public static let v18 = Self(for: .v18)
public static let v26 = Self(for: .v26)
}

extension visionOSViewVersion<DatePickerWithCompactStyleType, UIDatePicker> {
public static let v1 = Self(for: .v1)
public static let v2 = Self(for: .v2)
public static let v26 = Self(for: .v26)
}
#elseif canImport(AppKit) && !targetEnvironment(macCatalyst)
extension macOSViewVersion<DatePickerWithCompactStyleType, NSDatePicker> {
Expand All @@ -90,6 +92,7 @@ extension macOSViewVersion<DatePickerWithCompactStyleType, NSDatePicker> {
public static let v13 = Self(for: .v13)
public static let v14 = Self(for: .v14)
public static let v15 = Self(for: .v15)
public static let v26 = Self(for: .v26)
}
#endif
#endif
Expand Down
Loading