I was looking at this tutorial (https://developer.apple.com/documentation/vision/recognizing_objects_in_live_capture) and the problem is that when you rotate the device the view of the camera don't change frame size so you'll have a black space.
Any ideas to solve this problem?
In addition, I made my version of the app in SwiftUI (but the problem persists), so solution using SwiftUI are also appreciated!
Thanks in advance
I'm not sure how in SwiftUI, but here's how in UIKit:
Try setting the
videoGravity
:Then, this should take care of the orientation. This is based off of this answer.