This are the errors are occurs but this issue shows me after a few days before I was able too make the app but now this error message are coming in very file I have e24 issue in this error I have try many way to resolve this issue but any of them didn’t work I have tried to uninstall the Xcode nd install it the clean the build but still facing this issue **
error 1 -The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions.**
error 2- Missing argument for parameter ‘from’ in call ,Static method ‘buildExpression’ requires that ‘Button’ conform to ‘View’ , Cannot infer contextual base in reference to member ‘horizontal’Cannot infer contextual base in reference to member ‘top’ ,Value of type ‘Button’ has no member ‘navigationDestination’
struct TrackSlotDropDown: View {
let title: String
let prompt: String
let options: [String]
@Binding var selection: String?
@State private var isExpanded = false
var body: some View {
VStack(alignment: .leading, spacing: 10) {
Text(title)
.font(.footnote)
.foregroundColor(.black)
.opacity(0.8)
.padding(.horizontal)
HStack {
Text(selection ?? prompt)
Spacer()
Image(systemName: "chevron.down")
.font(.subheadline)
.foregroundColor(.gray)
.rotationEffect(.degrees(isExpanded ? 180 : 0))
}
.frame(height: 30)
.padding(.horizontal)
.onTapGesture {
isExpanded.toggle() // Toggle dropdown state
}
.background(Color.white)
.overlay(RoundedRectangle(cornerRadius: 2).stroke(Color.black))
.padding(.horizontal)
}
.overlay(
GeometryReader { geometry in
if isExpanded {
VStack {
Spacer()
VStack(alignment: .leading, spacing: 0) {
ForEach(options, id: .self) { option in
Button(action: {
selection = option
isExpanded.toggle() // Close dropdown when an option is selected
}) {
HStack {
Text(option)
.foregroundColor(selection == option ? Color.primary : Color.gray)
Spacer()
if selection == option {
Image(systemName: "checkmark")
.font(.subheadline)
}
}
.frame(height: 40) // Adjust height as needed
.padding(.horizontal)
}
}
}
.background(Color.white) // Background for dropdown options
.cornerRadius(8) // Rounded corners for dropdown options
.padding(10) // Add padding for dropdown options
.shadow(radius: 5) // Add shadow for depth
.frame(width: geometry.size.width * 0.8) // Set width to 80% of screen width
.alignmentGuide(.top) { _ in geometry.size.height * 0.5 } // Center vertically
Spacer()
}
.edgesIgnoringSafeArea(.all) // Ignore safe area to cover entire screen
.onTapGesture {
isExpanded.toggle() // Close dropdown when tapping outside
}
}
}
)
.padding(.top, 5)
}
}
#Preview {
TrackSlotDropDown(title: "Status", prompt: "Select", options: ["pending", "approved", "Inspection completed", "Pending uploaded"], selection: .constant("pending"))
}
that error coming in every file I want a solution for this