Search code examples
objective-ccocoa-touchpaginationuiscrollviewuipagecontrol

UIScrollView with controls repeating on every page?


I have perfectly working UIPageControl. I would like to add paging by swipe, and as I understood, it is done by UIScrollView. But all tutorials are done with images, I want to have controls (labels, buttons) repeating on every page.

Because UIScrollControl is working the way that it must have set its width * pages count, does it mean, that controls can be placed only in code, not in IB?

Should I place labels and buttons directly on UIScrollView?

Thanks


Solution

  • If you have a View Controller designed using IB with all its buttons and labels, then it is possible to add that View Controller as a subview of your UIScrollView as such:

    [scrollView addSubview:controller.view];

    scrollView being your UIScrollView and controller being your IB designed View Controller.