I have heard that viewDidLayoutSubviews
is the best place to alter the layout when we have used constraints.
So I jumped to viewDidLayoutSubviews
I have created three UIViews
and SubViewed
them on SuperView. I am not mentioning the code for frame calculation.
[self.view addSubview:imgMiddleCircle];
[self.view addSubview:imgFirstCircle];
[self.view addSubview:imgLastCircle];
Using this piece of I am adding these circles.
Now when I run my code In viewDidLayoutSubviews
I get following screens:
And when I switch to viewWillLayoutSubviews
I am getting this on screen:
Why I am getting extra two circles in viewDidLayoutSubviews
even I am creating three circles.
And why in viewWillLayout
gives the correct Output.