WindowResizability
The resizability of a window.
Declaration
struct WindowResizabilityOverview
Use the windowResizability(_:) scene modifier to apply a value of this type to a Scene that you define in your App declaration. The value that you specify indicates the strategy the system uses to place minimum and maximum size restrictions on windows that it creates from that scene.
For example, you can create a window group that people can resize to between 100 and 400 points in both dimensions by applying both a frame with those constraints to the scene’s content, and the contentSize resizability to the scene:
@main
struct MyApp: App {
var body: some Scene {
WindowGroup {
ContentView()
.frame(
minWidth: 100, maxWidth: 400,
minHeight: 100, maxHeight: 400)
}
.windowResizability(.contentSize)
}
}The default value for all scenes if you don’t apply the modifier is automatic. With that strategy, Settings windows use the contentSize strategy, while all others use contentMinSize. Windows on visionOS with a window style of volumetric also use the contentSize strategy.