Add native SwiftUI.Bindable support for iOS 17+#389
Merged
johnnewman-square merged 5 commits intomainfrom Apr 10, 2026
Merged
Conversation
Clients with a minimum deployment target of iOS 17 can now use SwiftUI's native @bindable property wrapper with Store, including the .sending(action:) API for custom action routing. - Add _NativeStoreBindable, mirroring _StoreBindable for native @bindable instead of @Perception.Bindable - Suppress false-positive Perception runtime warnings on iOS 17+ by setting skipPerceptionChecking in Store's state-reading paths - Add NativeBindableStoreTests covering all three sending overloads - Add NativeMultiCounterView sample demonstrating @bindable usage without WithPerceptionTracking Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
07d1637 to
9b46641
Compare
Replace @available annotations with guard #available + XCTSkip to prevent XCTest from failing on iOS 16 when it discovers but cannot execute availability-gated test methods. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
|
@codex review |
robmaceachern
approved these changes
Apr 10, 2026
Add iOS 17+ @bindable examples to the adoption guide and a native child-store observation test to cover the skipPerceptionChecking suppression in Store.access(). Fix trailing whitespace in test markers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
|
@robmaceachern I have addressed the feedback, thanks again. One thing I wanted to be sure to mention is that the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds support for the
.sending(...)API on iOS 17+ Bindables. The original implementation worked withPerception.Bindable, which is marked as obsolete on 17+, requiring clients to switch toSwiftUI.Bindablewhere these APIs didn't previously exist.Summary
_NativeStoreBindable, a native@Bindableequivalent of_StoreBindablefor iOS 17+ clients, supporting all three.sending()overloads (sink:action:,closure:, andaction:forSingleActionModel)skipPerceptionCheckinginStore's state-reading and child-store scoping paths, where thePerceptibleoverload ofPerceptionRegistrar.accessis selected at compile time even though native observation is trackingStoreTestsmirroring the existingPerception.Bindabletests, usingXCTSkipto skip on iOS 16NativeMultiCounterViewsample demonstrating@Bindableusage withoutWithPerceptionTracking, wired via#availableinMultiCounterScreenTest plan
WorkflowSwiftUI-Testson an iOS 17+ simulator — verify the 4 native binding tests passWorkflowSwiftUI-Testson an iOS 16 simulator — verify the native binding tests are skipped viaXCTSkipand existing tests still passObservableCompositionsample on iOS 17+ — verifyNativeMultiCounterViewis used with no Perception runtime warningsObservableCompositionsample on iOS 16 — verifyMultiCounterViewis used as fallback🤖 Generated with Claude Code