Hi everyone,
Something didn't work in my environment so I wrote some demo code:
import SwiftUI
@main
struct DemoApp: App {
var body: some Scene {
WindowGroup {
Color.accentColor.opacity(1/4)
.frame(idealWidth: 800, idealHeight: 800)
}
.windowIdealSize(.fitToContent)
}
}
I expected a 800*800 window (then +28pt top) using .windowIdealSize(.fitToContent)
. Otherwise I can't control these views that use up available space such as Color
, Spacer
, GeometryReader
, etc.
Was I missing something? Or this is a problem or intended framework design?
Environments:
- macOS 15.4.1 (24E263) and 15.5 beta 4 (24F5068b)
- Xcode 16.3 (16E140)