---
title: "presentationCompactAdaptation(_:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/presentationcompactadaptation(_:)"
---

# presentationCompactAdaptation(_:)

Specifies how to adapt a presentation to compact size classes.

## Declaration

```swift
nonisolated func presentationCompactAdaptation(_ adaptation: PresentationAdaptation) -> some View

```

## Parameters

- `adaptation`: The adaptation to use in either a horizontally or vertically compact size class.

## Discussion

Discussion Some presentations adapt their appearance depending on the context. For example, a sheet presentation over a vertically-compact view uses a full-screen-cover appearance by default. Use this modifier to indicate a custom adaptation preference. For example, the following code uses a presentation adaptation value of none to request that the system not adapt the sheet in compact size classes: struct ContentView: View {     @State private var showSettings = false

var body: some View {         Button("View Settings") {             showSettings = true         }         .sheet(isPresented: $showSettings) {             SettingsView()                 .presentationDetents([.medium, .large])                 .presentationCompactAdaptation(.none)         }     } } If you want to specify different adaptations for each dimension, use the presentationCompactAdaptation(horizontal:vertical:) method instead.

## See Also

### Adapting a presentation size

- [presentationCompactAdaptation(horizontal:vertical:)](swiftui/view/presentationcompactadaptation(horizontal:vertical:).md)
- [PresentationAdaptation](swiftui/presentationadaptation.md)
- [presentationSizing(_:)](swiftui/view/presentationsizing(_:).md)
- [PresentationSizing](swiftui/presentationsizing.md)
- [PresentationSizingRoot](swiftui/presentationsizingroot.md)
- [PresentationSizingContext](swiftui/presentationsizingcontext.md)
