Repository navigation
[iOS] Isolate Constrainable layout operations - #190
Merged
Merged
Conversation
Contributor
Author
|
This one's failing CI job also seems to be a simulator issue. |
jqsilver
marked this pull request as ready for review
October 20, 2026 19:09
brynbodayle
approved these changes
Oct 22, 2026
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.
Change summary
Isolate
Constrainableanchors, frames, owning views, installation, and layout helpers to the main actor. Keep identity, equality, container diffing, and model construction nonisolated. Declare nonisolated UIKit/group/spacer conformances on Swift 6.2+ with compiler-guarded fallbacks for older compilers. Mark spacer style Sendable for immutable style equality. Add compiler contracts and adapt existing Quick tests at layout invocation boundaries.Context
Inferred main-actor conformances can otherwise leak into
GroupItem<UIView>and group/spacer model construction. Isolating the entire protocol also isolates value wrappers used for diffing. This follows the focused direction discussed in #185: constrain layout operations while preserving nonisolated identity and equality. It retains tools version 5.5 and iOS 13 and does not apply package-wide default isolation or isolate the wholeGroupprotocol.How was it tested?
bash Tests/CompilerTests/check-constrainable.sh /tmp/epoxy-validation/layout-derived/Build/Products/Debug-iphonesimulator. Passes in Swift 5 and Swift 6 language modes with complete concurrency,InferIsolatedConformances, and warnings as errors.xcodebuild build -scheme EpoxyLayoutGroups -destination 'generic/platform=iOS Simulator' -derivedDataPath /tmp/epoxy-validation/layout-derived -clonedSourcePackagesDirPath /tmp/epoxy-validation/layout-packages SWIFT_STRICT_CONCURRENCY=complete OTHER_SWIFT_FLAGS='$(inherited) -enable-upcoming-feature InferIsolatedConformances' CODE_SIGNING_ALLOWED=NO.Epoxy-Packagetest scheme used a temporary package withSourcesandTestssymlinked to this branch; Quick 4.0.0 and Nimble 9.2.1, without dependency-file changes.Validation limit: a full-package build with complete concurrency and
InferIsolatedConformancesfails in unchangedCollectionViewScrollToItemHelper.swift:176; the same failure was reproduced on master. The isolated layout-module build succeeds with other existing concurrency warnings, while the consumer fixtures are warning-free.This changes compile-time layout access requirements; there is no intended visual change. Callers performing layout through
Constrainablemust run on the main actor. Recent Xcode build products and consumer probes use an effective iOS 15 minimum;Package.swiftstill declares iOS 13.Pull request checklist
CHANGELOG.mdentry in the Unreleased section.Please Review
@brynbodayle cc @andreacipriani