- July 30, 2025
- Mins Read
Add folowing line to Podfile and run ‘pod instal’.
pod ‘Sevruk-PageControl’
Or just drag and drop FoldingCell.swift file to your project
Add a new UIView to storyboard.
Inherit view from PageControl
.
Here is code example that uses UIScrollView.
import UIKit
import PageControl
class ViewController: UIViewController, UIScrollViewDelegate {
@IBOutlet weak var scrollView: UIScrollView!
@IBOutlet weak var pageControl: PageControl!
override func viewDidLoad() {
super.viewDidLoad()
scrollView.delegate = self
pageControl.numberOfPages = Int(scrollView.contentSize.width / scrollView.bounds.width)
}
func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
let page = scrollView.contentOffset.x / scrollView.bounds.width
pageControl.currentPage = page
}
}
let pageControl = PageControl()
addSubview(pageControl)
pageControl.numberOfPages = 5
pageControl.spacing = 14.0
pageControl.indicatorDiameter = 8.0
pageControl.currentIndicatorDiameter = 12.0
pageControl.indicatorTintColor = .darkGray
pageControl.currentIndicatorTintColor = .green
pageControl.currentPage = 1
PermissionsSwiftUI displays and handles permissions in SwiftUI. It is largely inspired by SPPermissions. The UI is highly customizable and resembles an Apple style. ...
Introduction PagerTabStripView is the first pager view built in pure SwiftUI. It provides a component to create interactive pager views ...
1. Taking Action When a Property Changes: Property Observers Swift lets you observe and respond to changes in a property’s ...