title: How to programmatically set a subview's frame to fit it inside its superview?
body: <p>I need to programmatically do the following. How can I do this? The code should be dynamic enough to fit a portrait view inside landscape also. The views are not UIImageViews.
   <img src="https://i.stack.imgur.com/sRGR3.png" alt="enter image description here"></p>