1

I'm trying to create a page that shows the detail view of an exercise so i passed in a binding variable exercisePlan but the previews say that it cannot ding $exercisePlan in scope even though it is already declared on top. I'm probably missing something but I'm not sure what.

`

import SwiftUI

struct ExercisePlanDetailView: View {
    @Binding var exercisePlan: ExercisePlan
    var body: some View {
            VStack {
                Text(exercisePlan.title)
            }
        }
    }
    

struct ExercisePlanDetailView_Previews: PreviewProvider {
    static var previews: some View {
        ExercisePlanDetailView(exercisePlan: $exercisePlan)
    }
}

`

Zudoturiku
  • 121
  • 7
  • 1
    Does this answer your question? [SwiftUI preview provider with binding variables](https://stackoverflow.com/questions/60105438/swiftui-preview-provider-with-binding-variables) Or this: https://stackoverflow.com/questions/56685964/swiftui-binding-initialize – workingdog support Ukraine Nov 13 '22 at 05:42

0 Answers0