I have the problem that the SafeArea get ignored in iOS 16. I am hosting a simple SwiftUI View inside a standard ViewController. See code below. The result is like in the picture. Left is iOS 15, where everything is like expected. Right side is iOS16.
ViewController:
override func viewDidLoad() {
super.viewDidLoad()
let myview = UIHostingController(rootView: MyView())
view.addSubview(myview.view)
myview.view.frame = view.frame
}
SwiftUI View:
struct MyView: View {
var body: some View {
VStack {
HStack{
Spacer()
Text("lol")
.font(.title)
.padding()
.background(Color.red)
}
Spacer()
}
}
}
