0

I am attempting to scale dot of the current page to be larger than the dots which are not 'selected'.

I am using the scrollview delegate to ascertain which page is current.

At the moment there is no change to the size of the dot.

How would I go about achieving this?

func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {

    var i = 0
    if(scrollView.contentOffset.x < scrollView.frame.width){

      pageControl.currentPage = 0
        pageControl.subviews.forEach {

            if(i == 0){
                print("Edit")
                $0.transform.scaledBy(x: 5, y: 5)
            }

            pageControl.layoutIfNeeded()
            i += 1
        }


    }else{
         pageControl.currentPage = 1
    }
}
MattBlack
  • 3,616
  • 7
  • 32
  • 58
  • You did not assign the result of `$0.transform.scaledBy(x: 5, y: 5)`. Maybe you mean `$0.transform = .identity.scaledBy(x: 5, y: 5)` – Cœur Mar 08 '19 at 11:01
  • Possible duplicate of [Scaling current dot of UIPageControl and keeping it centered](https://stackoverflow.com/questions/55060432/scaled-uipagecontrol-dot-isnt-centered) – Cœur Mar 11 '19 at 04:28

1 Answers1

0

UIPageControl is not that customizable. Use a library like this one

TAPageControl

Is works the same way as UIPageControl and you can easily customize current and non current page dots by setting the properties dotImage and currentDotImage.

Antenehs
  • 336
  • 1
  • 7