With the following setup:
- Xcode 16 beta 1-6 on iOS 18 or Xcode 16.1 beta with iOS 18.1
- Swift 6 language mode
- HStack (or any other Layout) with a ForEach showing items with an alignmentGuide view modifier
- An animation modifier layout animating when the array of items changes
When an item is removed from the array the app will crash.
An example file is attached to demonstrate the issue. If you comment out the alignmentGuide or the animation view modifiers the app won't crash but it will still log an issue.
I have confirmed the bug on iPhone 15 Pro simulator running iOS 18.0 betas 1, 2, 4, and 5 and iOS 18.1 beta 1 and on an iPhone 11 device running iOS 18.0 (22A5338b)
Seems like it's a bug with alignmentGuide. Here's a similar crash: https://developer.apple.com/forums/thread/760645?login=true