Mark's answer is correct for, but just to make it clearer.
Like the question, I was using
ZStack{
// Child content
}
.frame(width: 200, height: 500, alignment: .topLeading)
But this doesn't work, presumably because the frame is adding a parent view to the ZStack, and the alignment is not being added directly to the ZStack itself.
By taking the following approach of passing the alignment directly to the ZStack at initialisation, I was able to get the expected results with all children position top left.
ZStack(alignment: .topLeading) {
// Child content
}
.frame(width: 200, height: 500, alignment: .topLeading)
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: