Disclaimer :- Only for ios 9 and above (Stack View).
If you are deploying your app on ios 9 devices use a stack view.
Here are the steps :-
- Add a scroll view with constraints - pin to left, right, bottom, top (without margins) to superview (view)
- Add a stack view with same constraints to scroll view.
- Stack View Other Constraints :- stackView.bottom = view.bottom and stackView.width = scrollView.width
- Start adding your views. The scroll view will decide to scroll based on the size of the stack view (which is essentially your content view)