version 0.7 - swift 5
UIPagerViewController wrapper
You can use CocoaPods to install PagerTab by adding it to your Podfile:
PagerTab
Podfile
platform :ios, '9.0' use_frameworks! target 'YourTarget' do pod "PagerTab" end
To get the full benefits import PagerTab
import PagerTab
set up your PagerTabAppearance
PagerTabAppearance
let appearence = PagerTabAppearance( type: PagerTabType.fixedNumber(2), titleColors: [(.blue, .selected), (.blue, .highlighted), (.lightGray, .normal)] )
for the different customization options take a look at PagerTabAppearance init
public init(type: PagerTabType, selected: Int = 0, height: CGFloat = 50.0, color: UIColor? = .clear, titleColors: [(UIColor, UIControlState)]? = [(.black, .normal)], font: UIFont = UIFont.systemFont(ofSize: UIFont.systemFontSize) ) { ...
define your viewControllers
let PoutingVC: BeautifulViewController = { let vc = BeautifulViewController(text: "😡") vc.view.backgroundColor = UIColor.gray return vc }() let BombVC: BeautifulViewController = { let vc = BeautifulViewController(text: "💣") vc.view.backgroundColor = UIColor.lightGray return vc }() let NerdVC: BeautifulViewController = { let vc = BeautifulViewController(text: "🤓") vc.view.backgroundColor = UIColor.white return vc }() let SkullVC: BeautifulViewController = { let vc = BeautifulViewController(text: "☠️") vc.view.backgroundColor = UIColor.green return vc }()
set up the PagerTabPage array
PagerTabPage
let viewControllers: [PagerTabPage] = [( PoutingVC , "Pouting"), ( BombVC , "Bomb"), ( NerdVC , "Nerd"), ( SkullVC , "Skull") ]
init your PagerTab
let pager = PagerTab( viewControllers , appearence: appearence )
add it to your view
self.add(childController: pager, toView: self.view)
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
Pager
Requirements
Installation
CocoaPods
You can use CocoaPods to install
PagerTab
by adding it to yourPodfile
:To get the full benefits import
PagerTab
Usage example
set up your
PagerTabAppearance
for the different customization options take a look at
PagerTabAppearance
initdefine your viewControllers
set up the
PagerTabPage
arrayinit your
PagerTab
add it to your view
Example Preview