27.5 Cross Stack Alignment
A typical user interface layout will be created by nesting stacks to multiple levels. A key shortcoming of the standard alignment types is that they do not provide a way for a view in one stack to be aligned with a view in another stack. Consider the following stack configuration consisting of a VStack embedded inside an HStack. In addition to the embedded VStack, the HStack also contains a single additional view:
Figure 27-14
The corresponding declaration for the above nested layout reads as follows:
HStack(alignment: .center, spacing: 20) {
Circle()
.foregroundColor(Color.purple)
.frame(width: 100, height: 100)
VStack(alignment: .center) {
Rectangle()
...