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
YOU MIGHT ALSO LIKE...
ConfettiView

A SwiftUI View that emits confetti with user-defined shapes, images, and text.

SwiftUI Colour Wheel

A colour wheel made all in SwiftUI. There are 2 different colour wheels to choose from. The first main one ...

ColorPickerRing

A color picker implementation with color wheel appearance written in plain SwiftUI. It is compatible with UIColor and NSColor.

ASCollectionView

This repository is no longer maintained. Here's why: with the release of iOS 16 SwiftUI now enables most of the ...