github siteline/swiftui-introspect 27.0.0

2 hours ago

What's Changed

  • Added: Public range-based platform version predicates for iOS, tvOS, macOS, and visionOS, available with a normal import SwiftUIIntrospect.
import SwiftUI
import SwiftUIIntrospect

ScrollView {
    Text("Item")
}
.introspect(.scrollView, on: .iOS(.v13...)) { scrollView in
    scrollView.bounces = false
}

A range reuses its lower bound’s selector on later OS versions. If the underlying UIKit/AppKit type changes, the customization closure may not run. Custom introspectable types and @Weak still require @_spi(Advanced).

Swift Package Manager

.package(url: "https://github.com/siteline/swiftui-introspect", from: "27.0.0")
.product(name: "SwiftUIIntrospect", package: "swiftui-introspect")

Upgrading from 26.x

The 27.x line requires Swift tools 6.2 and macOS 12 or later for macOS deployments.

Menu picker, slider, default toggle, and checkbox toggle introspection are unavailable on macOS 27. Omit .v27 from their macOS version lists:

Slider(value: $value)
    .introspect(.slider, on: .macOS(.v12, .v13, .v14, .v15, .v26)) { slider in
        // Customize the NSSlider.
    }

Full Changelog: 26.1.0...27.0.0

Don't miss a new swiftui-introspect release

NewReleases is sending notifications on new releases.