I have one UIView which is transparent. This View is called "mainView"
I want to add a subview to mainView of the same size. So, I initialize it in the mainView Class itself: https://i.stack.imgur.com/pz6Ql.png It looks like this: [https://i.stack.imgur.com/Y8MEr.png] And that's exactly what I want!
But let's say I remove this code and I want to initialize a subView in my UIViewController: https://i.stack.imgur.com/aCpWf.png I created an outlet of the mainView and initialize with the bounds of mainView a subView.
Unfortunately, my view now looks now like this: https://i.stack.imgur.com/stekd.png But you can see in the code above I set the frame correctly to the frames of the view mainView.bounds
Can you explain why the size of the new View (subView) does not stay the same as when I initialized it in the mainView class itself?