My view contains an area on the bottom. I want to make it fill the 0.3 times of the screen height. However, if the UIScreen is deprecated, I cannot get the screen size on newer versions of iOS. Additionally, if I use GeometryReader, my screen breaks. I am new to SwiftUI and I believe there is another way to work with these type of situations rather than hardcoding the size. Any help is appreciated.
For example:
Button {
onButtonPressed()
} {
Text("Press Me")
}
.frame(
maxWidth: .infinity,
maxHeight: UIScreen.main.bounds.height * 0.3 // Can not do that anymore
)