Comments 3
Модифицируем QuoteView (добавляем модификаторы transition и animation):
struct QuoteView: View {
var quote : QuoteDataModel
var body: some View {
VStack(alignment: .leading, spacing: 5) {
Text(quote.latin)
.font(.title)
if quote.expanded {
Group() {
Divider()
Text(quote.russian).font(.body)
}.transition(.move(edge: .top)).animation(.default)
}
}
}
}
Результат:

Sign up to leave a comment.
SwiftUI: делаем Expandable/Collapsible секции в List view