I have created IPager
to meet the demands of UI/UX team at Robusta Studio © and it is used in multiple projects there
Cocoapod
pod 'IPager', :git => 'https://github.com/YousefAnsary/iPager.git
Swift Package Manager
.package(url: "https://github.com/YousefAnsary/iPager.git", from: "1.1")
Manually
Just copy IPager.swift
and IPagerCell.swift
from directory Sources/IPager
to your project
------------------------------------------------
All you need is creating IPager
UIView
with the relevant constraints in your XIB/StoryBoard or using Code and customize as you want using Inspectable Properties in Interface Builder or using Code
@IBInspectable public var dotSize: CGSize // def is 8*8
@IBInspectable public var selectedDotSize: CGSize // def is 14*14
@IBInspectable public var spacing: CGFloat // def is 8
@IBInspectable public var circularDot: Bool // def is true
@IBInspectable public var tint: UIColor // def is gray
@IBInspectable public var selectedTint: UIColor // def is blue
@IBInspectable public var isPageSelectionEnabled // def is false
public var didSelectedPageAt: ((Int) -> Void)?
public var numberOfPages: Int // def is 3
public var currentPage: Int // def is 0