Advertise here

Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Swapping through UIImages and having a UIPageControl

n0kxn0kx Posts: 16New Users *
I've not used the UIPageControl before and I'm wanting to create a very simple control that displays an image from an array, the image is swiped, a new image appears, and the UIPageControl updates to show the new index.

What's the simplest way to go about building this? Thanks!


  • BrianSlickBrianSlick Treadmill Desk Ninja Posts: 10,692Tutorial Authors, Registered Users @ @ @ @ @ @ @ @
    A UIPageControl by itself doesn't make any of these things happen. You tell the control how many dots it has, and which dot should be highlighted. The control will tell you when someone taps on it, and you can ask it what the current index is. This is all completely independent of what the rest of your UI is doing.

    As far as showing the images, you have several options to choose from. You might consider a collection view or a UIPageViewController. Each has a different way of letting you know when the user dragged around, so you can update the UIPageControl index. And each has a different way for you to manually switch to a new page when the user taps on a UIPageControl. And you always have the option of manually sliding views around, employing gesture recognizers, etc. Google should turn up numerous options, as this scenario has been asked about for many years.
    Professional iOS App Development. Available for hire.
    BriTer Ideas LLC - WWW | Facebook | Twitter | LinkedIn

    BTIKit | SlickShopper 2 | Leave a PayPal donation
Sign In or Register to comment.