I need to calculate the size of a card component depending of the size of its content. The content is text, and, if the text size increase due to accessibility (using accessibility options at iphone), the card should expand its size too.
@ViewBuilder var cards: some View {
(...)
GeometryReader { geometry in
HStack(spacing: 0) {
ForEach(items, id: .self) { item in
card(item)
.frame(width: ..., height: toCalculate)
.padding(.horizontal, ...)
}
}
(...)
}
The height I need to calculate is “toCalculate” var.
Is there any way to achieve that?