Skip to content

Conversation

@stackotter
Copy link
Collaborator

This PR is a simple extension of #245. Mia did all the work in that PR and I've just applied a few small changes that I wanted to add before merging into main to minimise breaking changes.

MiaKoring and others added 2 commits January 5, 2026 15:31
…ess (#245)

* Fixed reordering, insertion and removal in ForEach where Element: Identifiable

No non-identifiable support in this commit

* Made it work for non identifiables

StressTestExample is broken

* added fallback to old code where no keypath is specified

* added node reusing bypass after discovering first duplicate

* Fixed ForEach [MenuItem] compatibility, documentation improvement & cleanup

sadly an argument name seems to be required on menuitem forEach initializer, the compiler is apparently unable to infer the right child from the context.

* added tvOS excluding compiler flag for Slider Component in ForEachExample

* Fixed reordering, insertion and removal in ForEach where Element: Identifiable

No non-identifiable support in this commit

# Conflicts:
#	Examples/Bundler.toml
#	Examples/Package.swift
#	Examples/Sources/ForEachExample/ForEachApp.swift
#	Sources/SwiftCrossUI/Views/ForEach.swift

* Made it work for non identifiables

StressTestExample is broken

* should fix remaining rebase problems

* Changed version of swift-collections to 1.2.1 to match swift 5.10

* Implemented requested changes, potentially additional ForEach initializer pending

* fixed my merge messup

* replaced upToNextMajor with upToNextMinor because major would lead to pulling packages unsupported on swift 5.10 tooling

* requested changes: ignored notes.json, directly passed &children.stackLayoutCache, moved inserted inside the for loop
@stackotter stackotter merged commit d49bb7b into main Jan 5, 2026
22 checks passed
@stackotter stackotter deleted the stackotter/add_foreach_deprecated_init branch January 5, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants