Kenneth Kenneth - 1 year ago 148
Swift Question

UIPageControl for Swiping Only

I am using a UIPageControl connected to a paging UIScrollView (all programmatically). I want to only allow the user to swipe through the pages.

The UIPageControl currently properly updates in the UIScrollViewDelegate's

. However when you tap on the UIPageControl, the enabled dot jumps ahead one (which is the desired behavior for the home screen, etc but I do not want this tap to advance feature possible).

I want to prevent this behavior, but I can't find a way to easily disable it.

Answer Source

pageControl.userInteractionEnabled = false