You can make the .windowResizability(.contentSize) scene modifier conditional like so:
extension Scene {
func windowResizabilityContentSize() -> some Scene {
if #available(macOS 13.0, *) {
return windowResizability(.contentSize)
} else {
return self
}
}
}
And then use it on WindowGroup this way:
WindowGroup {
...
}
.windowResizabilityContentSize()
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: