A list of hierarchy elements will appear in InterfaceBuilder, which you will place in your view, drag a button from the view belonging to scrollView to the view containing the subview.
Your view hierarchy will look like this
mainView
|
|
Instead
mainView
|
|
, , ScrollView mainView. scrollView mainView, UIView scrollView UIButton UIScrollView