---
title: "imagePlaygroundGenerationStyle(_:in:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/imageplaygroundgenerationstyle(_:in:)"
---

# imagePlaygroundGenerationStyle(_:in:)

Sets the selected and allowed styles to use when displaying the image generation sheet.

## Declaration

```swift
nonisolated func imagePlaygroundGenerationStyle(_ style: ImagePlaygroundStyle, in allowedStyles: [ImagePlaygroundStyle] = ImagePlaygroundStyle.all) -> some View

```

## Parameters

- `style`: The style to pre-select in the sheet. This style must also be present in the allowedStyles parameter.
- `allowedStyles`: The list of styles that the sheet can display to people. Specify ImagePlaygroundStyle/all to make all styles available from the sheet.

## Return Value

Return Value An image playground sheet configured with the specified style information.

## Discussion

Discussion Configures the sheet with the specified style information. At presentation time, the sheet selects the style from the style parameter initially, but the person can change the selected style to any of the values in the allowedStyles parameter.

## See Also

### Generating images

- [imagePlaygroundOptions(_:)](swiftui/view/imageplaygroundoptions(_:).md)
- [imagePlaygroundSheet(isPresented:concept:sourceImage:onCompletion:onCancellation:)](swiftui/view/imageplaygroundsheet(ispresented:concept:sourceimage:oncompletion:oncancellation:).md)
- [imagePlaygroundSheet(isPresented:concept:sourceImage:onCompletion:onAdaptiveImageGlyphCreation:onCancellation:)](swiftui/view/imageplaygroundsheet(ispresented:concept:sourceimage:oncompletion:onadaptiveimageglyphcreation:oncancellation:).md)
- [imagePlaygroundSheet(isPresented:concept:sourceImageURL:onCompletion:onCancellation:)](swiftui/view/imageplaygroundsheet(ispresented:concept:sourceimageurl:oncompletion:oncancellation:).md)
- [imagePlaygroundSheet(isPresented:concept:sourceImageURL:onCompletion:onAdaptiveImageGlyphCreation:onCancellation:)](swiftui/view/imageplaygroundsheet(ispresented:concept:sourceimageurl:oncompletion:onadaptiveimageglyphcreation:oncancellation:).md)
- [imagePlaygroundSheet(isPresented:concepts:sourceImage:onCompletion:onCancellation:)](swiftui/view/imageplaygroundsheet(ispresented:concepts:sourceimage:oncompletion:oncancellation:).md)
- [imagePlaygroundSheet(isPresented:concepts:sourceImage:onCompletion:onAdaptiveImageGlyphCreation:onCancellation:)](swiftui/view/imageplaygroundsheet(ispresented:concepts:sourceimage:oncompletion:onadaptiveimageglyphcreation:oncancellation:).md)
- [imagePlaygroundSheet(isPresented:concepts:sourceImageURL:onCompletion:onCancellation:)](swiftui/view/imageplaygroundsheet(ispresented:concepts:sourceimageurl:oncompletion:oncancellation:).md)
- [imagePlaygroundSheet(isPresented:concepts:sourceImageURL:onCompletion:onAdaptiveImageGlyphCreation:onCancellation:)](swiftui/view/imageplaygroundsheet(ispresented:concepts:sourceimageurl:oncompletion:onadaptiveimageglyphcreation:oncancellation:).md)
