From 359a7e871b6d6cf8c04e1b81550f11797448200d Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 22 Dec 2025 14:55:27 -0500 Subject: [PATCH 1/2] Improve README documentation clarity - Add explanation of v26 unified versioning system to prevent confusion - Clarify when to use scope: .ancestor with better explanation - Update library author version range example to be more current - Fix minor hyphenation inconsistencies (opt-in, future-proof) This addresses potential confusion around the version jump from v18 to v26 and improves clarity for developers using the ancestor scope feature. Generated with Claude Code Co-Authored-By: Claude Opus 4.5 --- README.md | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 41bedc55..4fb4c2ae 100644 --- a/README.md +++ b/README.md @@ -43,15 +43,20 @@ ScrollView { 2. Traverse through all subviews between both marker views until a `UIScrollView` instance (if any) is found. > [!IMPORTANT] -> Although this method is solid and unlikely to break on its own, future OS releases require explicit opt in for introspection (`.iOS(.vXYZ)`) because underlying UIKit/AppKit types can change between major versions. +> Although this method is solid and unlikely to break on its own, future OS releases require explicit opt-in for introspection (`.iOS(.vXYZ)`) because underlying UIKit/AppKit types can change between major versions. -By default, `.introspect` acts on its receiver. Calling `.introspect` from inside the view you want to introspect has no effect. If you need to introspect an ancestor instead, set `scope: .ancestor`: +> [!NOTE] +> Version `.v26` represents Apple's unified versioning system introduced in 2025, where iOS, macOS, tvOS, and visionOS all align to version 26. This explains the version jump from `.v18` to `.v26` in the examples. + +By default, `.introspect` acts on its receiver. Calling `.introspect` from inside the view you want to introspect has no effect. + +**When to use `scope: .ancestor`:** If you need to introspect an ancestor view from within its child, set `scope: .ancestor`: ```swift ScrollView { Text("Item 1") .introspect(.scrollView, on: .iOS(.v13, .v14, .v15, .v16, .v17, .v18, .v26), scope: .ancestor) { scrollView in - // do something with UIScrollView + // This introspects the parent ScrollView, not the Text view } } ``` @@ -343,13 +348,15 @@ struct ContentView: View { Note for library authors ------------------------ -If your library depends on SwiftUI Introspect, declare a version range that spans at least the **last two major versions** instead of jumping straight to the latest. This avoids conflicts when apps pull the library directly and through multiple dependencies. For example: +If your library depends on SwiftUI Introspect, declare a version range that spans at least the **last two major versions** instead of jumping straight to the latest. This avoids conflicts when apps pull the library directly and through multiple dependencies. + +For example, if the current version is 26.0.0: ```swift -.package(url: "https://github.com/siteline/swiftui-introspect", "1.3.0"..<"27.0.0"), +.package(url: "https://github.com/siteline/swiftui-introspect", "25.0.0"..<"27.0.0"), ``` -A wider range is safe because SwiftUI Introspect is essentially “finished”: no new features will be added, only newer platform versions and view types. Thanks to [`@_spi(Advanced)` imports](https://github.com/siteline/swiftui-introspect#introspect-on-future-platform-versions), it is already future proof without frequent version bumps. +A wider range is safe because SwiftUI Introspect is essentially "finished": no new features will be added, only newer platform versions and view types. Thanks to [`@_spi(Advanced)` imports](https://github.com/siteline/swiftui-introspect#introspect-on-future-platform-versions), it is already future-proof without frequent version bumps. Community projects ------------------ From 9c4bde111fbf68a39eb2bfe0b8733751e8f1c5ff Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 22 Dec 2025 14:56:47 -0500 Subject: [PATCH 2/2] Update bug report template with current versions - Update version placeholder from '0.11.0' to '26.0.0' - Update OS placeholder from 'iOS 17' to 'iOS 18' (and add macOS example) These placeholders were outdated and could confuse users filing bug reports. Generated with Claude Code Co-Authored-By: Claude Opus 4.5 --- .github/ISSUE_TEMPLATE/bug_report.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 30b726fc..dbd00373 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -54,12 +54,12 @@ body: attributes: label: Version information description: The version of SwiftUIIntrospect used to reproduce this issue. - placeholder: "'0.11.0' for example, or a commit hash" + placeholder: "'26.0.0' for example, or a commit hash" - type: input attributes: label: Destination operating system description: The OS running the SwiftUIIntrospect module. - placeholder: "'iOS 17' for example" + placeholder: "'iOS 18' or 'macOS 15' for example" - type: input attributes: label: Xcode version information