Search code examples
iphoneobjective-ciosstoryboarduipagecontrol

iOS 5 Implementing a Page Controller with Storyboards in existing application


I have an application that needs to display a series of graphs (using Core Plot). I would like each of these graphs to be displayed in its own view preferably using a paged controller. I have 8 graphs.

Can someone direct me to a resource that shows how to implement something like this in iOS 5 with storyboards? I can't seem to find anything that explains this with storyboards at all..

Thanks,

Jack


Solution

  • It's quite easy. You just need to drag a UIScrollView into your controller, select it, and check the "Paging Enabled" option. You can also drag in a 'page control' and set yourself as the UIScrollViewDelegate Protocol delegate and update it when UIScrollView calls the -scrollViewDidScroll: method.

    Don't forget to set your UIScrollView's delegate by Control+Drag from the UIScrollView to your ViewController.

    Great tutorial on UIScrollView (Scroll down to "Paging with UIScrollView").
    Apple's Documentation with PageControl example.