I have subclassed a UIView and created few views inside it. I want to create an instance of this view inside my view controller's view and there's another custom view which will be placed below that view. I am not sure how do I put the second view below my first view.
When I debug the frames, I get {{0,0}, {0,0}}. I am using Masonry for view layout. I have tried several solutions from this thread
I have created a sample project which has the actual code I have tried. https://github.com/anuj-rajput/ViewSample
In this sample project, there are 2 subclasses of UIView
, PhoneVerificationTopView
and PhoneVerificationPhoneNumberView
and a view controller PhoneVerificationViewController
which creates objects from both these views. I need to perfectly order them in such a way they are perfectly aligned vertically (PhoneNumberView
below TopView
).
Am I doing something wrong? Is there a right way to subclass a UIView and then refer it in the controller?
This is how the view should look like