I was wondering if you could help me with a SwiftUI question. Specifically, I'm trying to create a reusable view that includes a NavigationStack with ForEach loop and has adjustable cells sizes. Can I make the size of NavigationStack to be dynamic only for visible cells and present every cell on full screen? Also, given that I need to reuse my view with my cells, I can't find a solution how to make the background color to be clear for NavigationStack. Basically, I just need a reusable view with a clean background and a few cells which I can click and present to fullscreen. Any tips or suggestions would be greatly appreciated!
My reusable view
import SwiftUI
struct TodaysHolidaysView: View {
var holidays: [HolidaysModel] = HolidayList.mockData
var body: some View {
NavigationStack {
VStack(spacing: 7.5) {
ForEach(holidays, id: \.id) { holiday in
NavigationLink {
HolidayDetailView(holiday: holiday)
} label: {
HolidayCell(holiday: holiday)
}
}
}
.frame(height: .infinity)
}
.cornerRadius(15)
.padding(.all, 10)
}
}
struct TodaysHolidaysView_Previews: PreviewProvider {
static var previews: some View {
TodaysHolidaysView()
}
}