Can anyone give me assistance on how to fix this. My preview crashed because a Fatal Error in ModelData.
This is how my ModelData looks:
import SwiftUI
struct SutraokeDetail: View {
@Environment(ModelData.self) var modelData
var sutra: Sutras
var body: some View {
@Bindable var modelData = modelData
ScrollView {
CircleImage(image: sutra.image)
.offset(y: -130)
.padding(.bottom, -130)
VStack(alignment: .leading) {
HStack{
Text(sutra.name)
.font(.title)
Spacer()
Text(sutra.text)
}
}
}
}
} #Preview { let modelData = ModelData() return SutraokeDetail(sutra: modelData.sutras[0]) .environment(modelData) }