1

I want to implement a page control in my project so that every view can be accessed through swiping left or right. Every example I have looked at is to do with images, not views. I've been studying this and its of course images again. My application is a single view application. I'm not really sure what code snippets to give you so far, I don't think I do because I haven't done anything on this yet. If you need specifics, please comment and ask me, i'll be here all day.

Please help me! Thanks.

wogwog
  • 99
  • 1
  • 11

2 Answers2

0

The same idea should apply in the tutorial you cited. They're adding UIImageView to a UIScrollView. So in your case, instead of UIImageView just use UIView. Also you can think of the pageImages array as a data source about your views. For example, instead of an array of UIImage you can just have an array of some model object that helps you configure your view. However, keep in mind that the implementation in the tutorial for your case won't scale if you plan to have a lot of UIViews. That's because you want to effectively reuse views that aren't showing. When it gets to that point, you're better off implementing a UITableView that scrolls horizontally.

fyell
  • 221
  • 1
  • 7
  • Yeah i understand, thanks for the comment, I'm pretty new to programming so I don't understand how to do half of what you said. Are you saying all I do is change the image views to UIViews? – wogwog Jan 27 '15 at 07:06
  • Yes. Since you're new to iOS programming, I highly recommend looking into understanding Model-View-Controller and UITableView. It will help you grasp the design patterns used for making components similar to what you're working on now. – fyell Jan 27 '15 at 07:17
  • I already know a lot about UITableViews, just not really what I need to do here.. – wogwog Jan 27 '15 at 08:19
0

You can use UIPageViewController for paging effect. Check out this tutorial. It is written in obj-c but who cares. It will give you idea about using UIPageViewController.

mustafa
  • 15,254
  • 10
  • 48
  • 57
  • Yer I've looked at this before, i've never worked with Obj-c before, i know i have to just understand what methods and stuff but I know I will stuff something up, I just can't follow that.. – wogwog Jan 27 '15 at 08:59