I’m making an app, using Apple’s new framework SwiftUI, but I found a problem.
I want to get the height of user’s device. When I ‘m using UIScreen.main.bounds.height in the SwiftUI code, Xcode Preview will crash, but with no reason!? When I remove that line of code, the issue disappeared.
So, how do I get the user’s screen height, and use it in SwiftUI?
VStack,ZStacketc.