Closed 0xLeif closed 4 years ago
Expected:
let innerView = View(backgroundColor: .blue).frame(height: 100, width: 100)
let stack = ZStack {
[
innerView
]
}
view.embed {
stack
.activateLayoutConstraints {
[
innerView.centerXAnchor.constraint(equalTo: stack.centerXAnchor),
innerView.centerYAnchor.constraint(equalTo: stack.centerYAnchor)
]
}
}
Since Variable used within its own initial value
doesn't allow stack
to be referenced:
let stack = ZStack {
[
innerView
]
}
.activateLayoutConstraints {
[
innerView.centerXAnchor.constraint(equalTo: stack.centerXAnchor),
innerView.centerYAnchor.constraint(equalTo: stack.centerYAnchor)
]
}
Correct ZStack usage in SwiftUIKit ATM
Expected: