Alter PageControl sample code provided by Apple to load 3 separate UIViews
So I would like to modify the PageControl sample code provided by Apple so that instead of loading a single imageView and modifying a label through code, it loads 3 separate UIViews (3 pages with 3 dots at the bottom). I need to be able to create the 3 views in IB so that I can drag 12 buttons onto each view and connect the buttons to the actions in my code. I'm assuming that I will just drag 3 views into the "MyView.xib" file and then customize each of the views from there (vs. creating completely separate .xib files to hold each view).
So I need to alter the code so that it knows that the first page it should load (and the first dot of the page control) is "view1" in the "MyView.xib" file and that the second page it should load (and the second dot on the page control) is "view2" from the "MyView.xib" file and the the third page and third dot it should load is "view3" from the "MyView.xib" file.
If creating a separate .xib file each view would be better, then I need to know how to alter the PageContol sample code to tell it to load the first .xib file for the first page, the second .xib for the second page, and so on.
I know this is a very specific way of doing this, but I already have a working application that is built in this way (a single view with 12 buttons, all created in IB). All I'm trying to do is add a second and third page of buttons to offer more content. Trying get the UIScrollView/Paging implemented has been a nightmare.
Am I approaching this the right way? I've seen that many other people have had this problem, but I just can't seem to find any code that matches specifically what I'm trying to do here. Any and all help will be greatly appreciated.
|