When I run my app simulation in Xcode 11, it works fine (portrait or landscape). But when I rotate, it doesn't resize to the appropriate constraints I set for that orientation.
Sim in Landscape after rotation
If I stop the app from running in the background and route the simulation then open it, then it works fine.
How can I resize the content while the device rotates?




I think your problem lays in your
heightandwidthconstraints.Try removing
MCC.width = 812andMCC.height = 376. The remaining constraints you have set for your label will keep it in the centre of yourVideo layerview.Also try removing
height = 2000on yourVideo Layerview as the remaining constraints you have set should keep it bound to the edges of its view.The problem with setting height and width constraints explicitly is when you rotate the device the height and width of the device changes. For example when you run your app (starting in portrait) you have a max height of 896 and width of 414 points on an iphone 11. But when you rotate it to landscape those values swap so you now have a max height of 414pt and a width of 896 points.
Run your app in portrait, after you rotate it have a look in
Debug--View Debugging--Capture View Hierarchy(in the Xcode menu not the simulator menu). I think you will find that yourVideo layeris extending past the superViewDo you want your
Video layercontent to cover the whole screen? if so in the attributes inspector setContent ModetoAspect Fillthis will clip some of the content. If you want all of the content visible set it toAspect Fit.