---
title: "workoutPreview(_:isPresented:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/workoutpreview(_:ispresented:)"
---

# workoutPreview(_:isPresented:)

Presents a preview of the workout contents as a modal sheet

## Declaration

```swift
nonisolated func workoutPreview(_ workout: WorkoutPlan, isPresented: Binding<Bool>) -> some View

```

## Parameters

- `workout`: The WorkoutContainer the preview displays
- `isPresented`: A binding to a Boolean value that determines whether to present the preview

## Discussion

Discussion struct WorkoutPreviewer: View {     let workout: WorkoutPlan     @State var presented: Bool = false     var body: some View {         Button {             isPresented = true         } label: {             WorkoutContainerView(workout)         }         .workoutPreview(workout, isPresented: $presented)     } }

## See Also

### Accessing health data

- [healthDataAccessRequest(store:objectType:predicate:trigger:completion:)](swiftui/view/healthdataaccessrequest(store:objecttype:predicate:trigger:completion:).md)
- [healthDataAccessRequest(store:readTypes:trigger:completion:)](swiftui/view/healthdataaccessrequest(store:readtypes:trigger:completion:).md)
- [healthDataAccessRequest(store:shareTypes:readTypes:trigger:completion:)](swiftui/view/healthdataaccessrequest(store:sharetypes:readtypes:trigger:completion:).md)
