IOS - UIPageControl page page indicators do not change using UISwipeGestureRecognizer

I use UIPageControl and UISwipeGestureRecognizer to switch between the two view controllers of my application. I changed this tutorial without using scroll.

I have 2 questions:

1) Using swipe gestures changes the controllers / view pages, but not the dots indicating the current page. I tried

 if (self.pageControl.currentPage == 0) { self.pageControl.currentPage = 1 } 

but I'm not sure why it is not working. Output Available

 @property (strong, nonatomic) IBOutlet UIPageControl *pageControl; 

2) I use - (IBAction)changePage:(id)sender to change the page. I would like to know how to go to the page when clicking on a certain point. I want to say that when I click on point 1, I have to go to the first view controller and click on point 2, I have to go to the second view controller.

+1
source share
1 answer

You need to know where the points are and add buttons above them or click gestures. I do not know how to work where there are dots - there is no public API for this. And from the user's point of view, the points are too small to touch. You must not do this. But feel free to add buttons / gestures to either end of the control - if they are of normal size ...

0
source

Source: https://habr.com/ru/post/912751/


All Articles