I\'m using SwiftUI to develop a new macOS application and can\'t figure out how to define the window size. In the AppDelegate, the window size is defined as shown below:
I did do it this way. It got a startup size and resizable.
struct windowSize {
let minWidth : CGFloat = 100
let minHeight : CGFloat = 200
let maxWidth : CGFloat = 200
let maxHeight : CGFloat = 250
}
struct ContentView : View {
var body: some View {
Group() {
VStack {
Text("Hot Stuff")
.border(Color.red, width: 1)
Text("Hot Chocolate")
.border(Color.red, width: 1)
}
}
.frame(minWidth: windowSize().minWidth, minHeight: windowSize().minHeight)
.frame(maxWidth: windowSize().maxWidth, maxHeight: windowSize().maxHeight)
.border(Color.blue, width: 1)
}
}