In iOS 18 you can do this with new containers API, view builder is now iterable, but your implementation will probably work in more iOS versions.
developer.apple.com/doc…
https://developer.apple.com/documentation/SwiftUI/Creating-custom-container-views
For your security, we need to re-authenticate you.
Click the link we sent to , or click here to sign in.
In iOS 18 you can do this with new containers API, view builder is now iterable, but your implementation will probably work in more iOS versions.
https://developer.apple.com/documentation/SwiftUI/Creating-custom-container-views