SwiftUI method for obtaining status bar and navigation bar

All the articles only introduce the method of UIkit acquisition, and cannot be acquired using UIApplication.shared.statusBarFrame.height after iOS13.0
To get Navigation Bar you must embed your View In a NavigationView

eg :
Code Block
struct ContentView: View {
var body: some View {
NavigationView {
Text("Hello")
.navigationBarTitle("Any title")
}
}
}



SwiftUI method for obtaining status bar and navigation bar
 
 
Q