FlexiblePageControl
  • November 26, 2023

A flexible UIPageControl like Instagram.

Overview


Install


Carthage

For Installing with Carthage, add it to your Cartfile.

github “shima11/FlexiblePageControl”

$ carthage update

CocoaPods

For installing with CocoaPods, add it to your Podfile.

pod “FlexiblePageControl”

$ pod update

Usage


let pageControl = FlexiblePageControl()
pageControl.numberOfPages = 10
view.addSubview(pageControl)

Customize

// color
pageControl.pageIndicatorTintColor = color1
pageControl.currentPageIndicatorTintColor = color2

// size
let config = FlexiblePageControl.Config(
displayCount: 7,
dotSize: 6,
dotSpace: 4,
smallDotSizeRatio: 0.5,
mediumDotSizeRatio: 0.7
)

pageControl.setConfig(config)

Update page

 

func scrollViewDidScroll(_ scrollView: UIScrollView) {
pageControl.setProgress(contentOffsetX: scrollView.contentOffset.x, pageWidth: scrollView.bounds.width)
}

or

pageControl.setCurrentPage(at: page)

GitHub


View Github

#carthage #cocoapods #instagram #ios #swift #uipagecontrol
YOU MIGHT ALSO LIKE...
EEStackLayout

A vertical stackview which takes subviews with different widths and adds them to it's rows with paddings, spacings etc.

AudioManager

AudioManager is a Swift package that provides a modular and easy-to-use interface for implementing audio feedback in your applications. It ...

CameraBackground

Features Both front and back camera supported. Flash modes: auto, on, off. Countdown timer. Tap to focus. Pinch to zoom. Usage  

DKCamera

Description A light weight & simple & easy camera for iOS by Swift. It uses CoreMotion framework to detect device orientation, so ...