Pager is the simplest and best way to implement sliding view controllers in Swift

Related tags

Tab Bar Pager
Overview

Language

Pager is the simplest and best way to implement sliding view controllers.

Installation

Drop in the Spring folder to your Xcode project.

Or via CocoaPods pre-release:

platform :ios, '8.0'
pod 'Pager'
use_frameworks!

Usage

Subclass PagerController (as it's a UIViewController subclass) and implement data source methods in the subclass.

Usage with Code

override func viewDidLoad() {
	super.viewDidLoad()
	self.dataSource = self
}

Data Source

func numberOfTabs(pager: PagerController) -> Int
func tabViewForIndex(index: Int, pager: PagerController) -> UIView
optional func viewForTabAtIndex(index: Int, pager: PagerController) -> UIView
optional func controllerForTabAtIndex(index: Int, pager: PagerController) -> UIViewController

Delegate

optional func didChangeTabToIndex(pager: PagerController, index: Int)
optional func didChangeTabToIndex(pager: PagerController, index: Int, previousIndex: Int)
optional func didChangeTabToIndex(pager: PagerController, index: Int, previousIndex: Int, swipe: Bool)

Contact

Pager is a port from CKViewPager to swift.

Licence

Pager is MIT licensed. See the LICENCE file for more info.

Comments
  • Is it possible to have fixed 2 non moving tabs?

    Is it possible to have fixed 2 non moving tabs?

    If i have 2 tabs initially both tabs are left aligned but as soon as i move to next tab the center property starts working. Even i set centerCurrentTab to false it still doesn't work

    opened by jovanpreet 7
  • Error with using TabBarController

    Error with using TabBarController

    If I added TabBarController to the ViewController with Pager

    I will got error in PagerController.swift Line 270 "var frame: CGRect = self.tabsView!.frame" fatal error: unexpectedly found nil while unwrapping an Optional value (lldb)

    Is it not support using TabBar??

    opened by wayne1203 6
  • Push view in child VC

    Push view in child VC

    Hey,

    How can i push a view in a child,

    I ve got 2 child View Controller with table view in these When i select a row, i cant use my navigation controller of these views, i need to use the super one, which implement Pager,

    Can someone found a solution ? Thanks

    opened by gorbat-o 5
  • Memory leak fix and top/bottom bar height ignore option.

    Memory leak fix and top/bottom bar height ignore option.

    Data source and delegate variables are set to weak to prevent a retain cycle, which prevents the PagerController objects to deallocate from memory.

    ignoreTopBarHeight and ignoreBottomBarHeight options are added so the view can be sized appropriately if it is embedded in as a child view controller (through Container View in storyboard).

    opened by matijakregar 4
  • Crash when swiping between tabs a few times

    Crash when swiping between tabs a few times

    I'm experiencing this issue at 1.0.10. The app stops at line 466 of PagerController.swift. Here's the log:

    *** Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'A view can only be associated with at most one view controller at a time! View <UITableView: 0x15e1ea800; frame = (0 0; 375 510); clipsToBounds = YES; autoresize = W+H; gestureRecognizers = <NSArray: 0x15ea58a30>; layer = <CALayer: 0x15ea02bd0>; contentOffset: {0, 0}; contentSize: {375, 36102.5}> is associated with <UIViewController: 0x15e9c4770>. Clear this association before associating this view with <UIViewController: 0x15ea8fc50>.'
    
    bug 
    opened by marciogranzotto 3
  • Update Cocoapods to new version

    Update Cocoapods to new version

    Changes:

    Fixes #6 - Scrolling tabs quickly using swipe gestures will lead to a crash.

    Todo:

    • [x] update .podspec with new version
    • [x] create new tag on Git
    • [x] push to CocoaPods with pod trunk push [Pager.podspec]
    opened by lfarah 3
  • Tabs beyond the 3rd tab aren't visible when using swipe gestures

    Tabs beyond the 3rd tab aren't visible when using swipe gestures

    This code also has the same bugs as the CKViewPager, scrolling tabs quickly using swipe gestures will lead to a crash.

    https://github.com/lucoceano/CKViewPager/issues/4

    opened by ycastonguay-cbc 3
  • Pager tab size dynamically

    Pager tab size dynamically

    Hello, how can I change the size of my pager tab dynamically? I'm struggling now because I have long titles and short titles at the same time... How can I make the pager short for the short title, and, long for the long one? Appreciate any help.

    opened by SafeenAzad 2
  • Crash on pushviewcontroller to pagercontroller

    Crash on pushviewcontroller to pagercontroller

    I'm having a viewcontroller with navigation controller. When I click a button I push to secondviewcontroller which uses PagerController,PagerDataSource. The swiping of tabs works fine here. But when I click < Back in the navigation bar, the app crashes. topLayoutGuide += self.navigationController!.navigationBar.frame.size.height , error is pointed at this location. Log showed up fatal error: unexpectedly found nil while unwrapping an Optional value . frame value becomes zero.

    bug 
    opened by anuraagdjain 2
  • View Will appear of current view controller is called when pushing new view controller

    View Will appear of current view controller is called when pushing new view controller

    I have a strange issue, I have a navigation controller which contains the pager, when I try to push another view controller from the navigation controller, the view will appear method of the view controller inside the first tab is called, how can I solve this? thanks

    opened by AceCracked 0
  • index can go out of range

    index can go out of range

    in selectTabAtIndex the index is being compared to tab count to see if it is >= this should actually be just > as index starts at 0 where count starts at 1. resulting impact is that application can crash as index is set out of range.

    opened by lofthousAA 0
  • Pager content not showing regularly with UITableView

    Pager content not showing regularly with UITableView

    I ran into the following problem: I am using PagerController to show table views of historic data, i.e. each Pager Tab is a week and on each tab view there is the same UITableView displayed (with different data, though).

    Currently, the app starts up in the "this week" tab and this weeks' data is showing correctly. When I tap "last week", the tab swipes to the right and the table view reloads. Everything works fine until this point.

    But when I navigate back to "this week" now, the table view completely disappears and no data whatsoever is shown. I've tried a couple of things to fix this behavior but I am out of ideas now.

    opened by caloon 3
  • Wrong behavior click on tab and swipe

    Wrong behavior click on tab and swipe

    opened by bit-world 0
Owner
Lucas Oceano
Lucas Oceano
Paging view controller and scroll tab view

TabPageViewController Description TabPageViewController is paging view controller and scroll tab view. Screenshot Infinity Mode Limited Mode Customiza

M 1.3k Jan 7, 2023
A fully customizable container view controller to display a set of ViewControllers in a horizontal scroll view. Written in Swift.

DTPagerController This is a control for iOS written in Swift. DTPagerController is simple to use and easy to customize. Screenshots Default segmented

Tung Vo 290 Nov 13, 2022
A lightweight customized tabbar view. 📌

A lightweight customized tabbar view. Screenshots Features Installation Setup ToDos Credits Thanks License Screenshots Features Easily Configurable an

Hemang 137 Dec 16, 2022
™️ A powerful paging view controller with interactive indicator bars

⭐️ Features Easy to implement page view controller with interactive indicator bars. Highly adaptable and powerful customization. Fully extensible with

UI At Six 2.5k Jan 2, 2023
RAMAnimatedTabBarController is a Swift UI module library for adding animation to iOS tabbar items and icons. iOS library made by @Ramotion

ANIMATED TAB BAR Swift UI module library for adding animation to iOS tabbar items and icons.

Ramotion 11k Jan 8, 2023
:octocat: AdaptiveController is a 'Progressive Reduction' Swift UI module for adding custom states to Native or Custom iOS UI elements. Swift UI component by @Ramotion

ADAPTIVE TAB BAR 'Progressive Reduction' module for adding custom states to Native or Custom UI elements. We specialize in the designing and coding of

Ramotion 2k Nov 9, 2022
Folding Tab Bar and Tab Bar Controller

FoldingTabBar.iOS Folding Tab Bar and Tab Bar Controller Inspired by this project on Dribbble Also, read how it was done in our blog Requirements iOS

Yalantis 3.7k Dec 21, 2022
Aesthetic floating tab bar ––– SwiftUI & Combine ⛓️ Importable via Swift Package Manager 📦

FloatingTabBar An aesthetic floating tab bar made with SwiftUI & Combine importabable via Swift Package Manager ?? Based off BottomBar-SwiftUI Preview

10011.co 135 Jan 8, 2023
youtube iOS app template written in swift 5

Youtube iOS Template Youtube iOS Template is developed by Haik Aslanyan and written in Swift 3. Purpose of this repo is to show how ViewControllers ca

Henry Aslanyan 2.5k Jan 4, 2023
SwipeViewController is a Swift modification of RKSwipeBetweenViewControllers - navigate between pages / ViewControllers

SwipeViewController What is SwipeViewController? SwipeViewController enables you to modify the navigation bar and implement 'Swipe Buttons' that can u

Marek Fořt 657 Dec 6, 2022
Animated top/bottom segmented control written in Swift.

Segmentio Animated top/bottom segmented control written in Swift. Check this project on dribbble. Requirements Xcode 10 iOS 8.x+ Swift 5.0 Installatio

Yalantis 2.4k Jan 9, 2023
A custom tab bar controller for iOS written in Swift 4.2

A custom tab bar controller for iOS written in Swift 4.0 Screenshots Installation Cocoa Pods: pod 'AZTabBar' Swift Package Manager: You can use The Sw

Antonio Zaitoun 335 Dec 11, 2022
🐛 WormTabStrip ViewPager for iOS written in Swift, which gives continuous feedback to the user when scrolling

Worm Tab Strip Worm Tab Strip is inspired by android SmartTabStrip, android view pager like library for iOS written in swift. Basically it was build u

EzimetYusup 176 Dec 13, 2022
Aesthetic floating tab bar ––– SwiftUI & Combine ⛓️ Importable via Swift Package Manager 📦

FloatingTabBar An aesthetic floating tab bar made with SwiftUI & Combine importabable via Swift Package Manager ?? Based off BottomBar-SwiftUI Preview

10011.co 134 Jan 5, 2023
CustomTabBar - A Custom TabBar Built Using Swift

CustomTabBar Thanks to Riccardo Cipolleschi for his awesome tutorial. The TabBar

SM Arif Ahmed 1 Feb 14, 2022
LNPopupController is a framework for presenting view controllers as popups of other view controllers, much like the Apple Music and Podcasts apps.

LNPopupController LNPopupController is a framework for presenting view controllers as popups of other view controllers, much like the Apple Music and

Leo Natan 2.9k Jan 2, 2023
🚀 Elegant Pager View fully written in pure SwiftUI.

PagerTabStripView Made with ❤️ by Xmartlabs team. XLPagerTabStrip for SwiftUI! Introduction PagerTabStripView is the first pager view built in pure Sw

xmartlabs 482 Jan 9, 2023
⛵️ URLNavigator provides an elegant way to navigate through view controllers by URLs.

URLNavigator ⛵️ URLNavigator provides an elegant way to navigate through view controllers by URLs. URL patterns can be mapped by using URLNavigator.re

Suyeol Jeon 2.6k May 27, 2021
A scroll pager that displays a list of tabs (segments) and manages paging between given views

ScrollPager A scroll pager similar to the one in Flipboard. The control creates a tabbar given a title or an image, and has the option of connecting t

Aryan Ghassemi 512 Aug 31, 2022
ZImageCropper is a simplest way to crop image to any shapes you like.

ZImageCropper ZImageCropper is a simplest way to crop image to any shapes you like. Example To run the example project, clone the repo, and run pod in

Mohammad Zaid Pathan 219 Dec 17, 2022