In case others see this, ForEach does everything a For loop does except that ForEach is designed to be used with SwiftUI. ForEach returns the needed view.
Image, color and file literals were removed from Xcode 13's code completion. So instead of typing "image lit", type the code: #imageLiteral(resourceName: "")
This problem still appears to be a bug in Xcode 13.0 using SwiftUI. The dismiss() works fine in my case until I select a toggle button on that view. Then the dimiss() stops working.
In case others see this, ForEach does everything a For loop does except that ForEach is designed to be used with SwiftUI. ForEach returns the needed view.
Image, color and file literals were removed from Xcode 13's code completion. So instead of typing "image lit", type the code: #imageLiteral(resourceName: "")
This problem still appears to be a bug in Xcode 13.0 using SwiftUI. The dismiss() works fine in my case until I select a toggle button on that view. Then the dimiss() stops working.