A scroll pager that displays a list of tabs (segments) and manages paging between given views

Related tags

Tab Bar ScrollPager
Overview

ScrollPager Version

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 to a UIScrollView to automatically present given views and manage paging between these views

alt tag

Usage:

Drag and drop a UIView into storyboard or xib.

OPTIONAL: If you like to use a scroll view assign the outlet to a scrollView.

Tab with text

scrollPager.addSegmentsWithTitles(["Home", "Public Feed", "Profile"])

Tab with images and views (will automatically add paging to scrollview and displays the views accordingly)

scrollPager.addSegmentsWithTitlesAndViews([
  ("Home", firstView),
  ("Public Feed", secondView),
  ("Profile", thirdView)
])

Tab with images

secondScrollPager.addSegmentsWithImages([
  UIImage(named: "envelope")!,
  UIImage(named: "home")!
])

Tab with images and views (will automatically add paging to scrollview and displays the views accordingly)

scrollPager.addSegmentsWithImagesAndViews([
  (UIImage(named: "envelope")!, firstView),
  (UIImage(named: "home")!, secondView),
  (UIImage(named: "anotherImage")!, thirdView)
])
Comments
  • Crash while setting up without InterfaceBuilder

    Crash while setting up without InterfaceBuilder

    I am using ScrollPager in code and trying to set up with my viewControllers. These controllers are using AutoLayout to setup constraints.

    let library = ImagePickerController()
    
    let photo = CameraViewController()
    
    lazy var bottomScrollPager: ScrollPager = { [unowned self] in
      let scrollPager = ScrollPager()
      scrollPager.translatesAutoresizingMaskIntoConstraints = false
      scrollPager.addSegmentsWithTitlesAndViews([("LIBRARY", self.library.view),("PHOTO", self.photo.view),("VIDEO", UIView())])
      scrollPager.delegate = self
      return scrollPager
    }()
    

    But the views did not appear. Also application crashed:

    fatal error: unexpectedly found nil while unwrapping an Optional value

    Error shows on the for view in scrollView!.subviews line;

    private func addViews(segmentViews: [UIView]) {
        for view in scrollView!.subviews {
            view.removeFromSuperview()
        }
    
        for i in 0..<segmentViews.count {
            let view = segmentViews[i]
            scrollView!.addSubview(view)
            views.append(view)
        }
    }
    

    I noticed that the scrollView is optional which marked with ? and when I am not in IB or xib. I guess that the reason why the crash happened?

    bug 
    opened by wongzigii 8
  • when setSelectedIndex:1:true:true App crash

    when setSelectedIndex:1:true:true App crash

    When setSelectedIndex is called, the error :Array is out of index is thrown, when i debugged your code, i found viewarray doesn't have any views also the buttons array !

    opened by Meseery 8
  • Add ViewControllers to ScrollPager

    Add ViewControllers to ScrollPager

    How I can add a viewController to the ScrollPager? In my case i have a collectionView In a view controller and i want load like a view in the scrollPager. I do this, but it shows a with view.

    let viewController = ViewController() let fourthView = viewController.view scrollPager.delegate = self scrollPager.addSegmentsWithTitlesAndViews([ ("Profile", thirdView), ("One More", fourthView) ]) scrollPager.delegate = self

    Can u help me? I really need this scrollPager

    opened by mperezrojas 7
  • How to use multiple view controllers

    How to use multiple view controllers

    Hello, how to show view controllers instead of UIView(UILabel) on each page?

    I've searched on Google that I can used container view controllers. But I'm a bit stuck to combined it with this library?

    can you give me some hints how to implement it? or maybe examples code.

    Thank you very much and sorry for my bad English.

    best regards,

    opened by iril7Langit 3
  • Disable horizontal scrolling

    Disable horizontal scrolling

    Hey, is it possible to disable horizontal scrolling? I only want the buttons to change the views because my views are all table views and I want to enable actions on table cells.

    opened by gnijuohz 2
  • Horizontally scroll between segments ?

    Horizontally scroll between segments ?

    Hi,

    I really love what you did so far with the ScrollPager, it's really well implemented & easy to understand.

    One question though :

    • Is it possible to horizontally scroll between the segments if there is too many ?

    Thanks.

    enhancement 
    opened by nsbraksa 2
  • Not possible to add a view controller's view?

    Not possible to add a view controller's view?

    Hi, how can I add a view that belongs to a view controller? If I do that, when I interact with something it crashes without exception. You know how to make some work around? I really want to use this on my project.

    Thanks

    opened by kosicki123 2
  • addSegmentsWithTitlesAndViews doesn't appear in Objective-c Header file

    addSegmentsWithTitlesAndViews doesn't appear in Objective-c Header file

    When using the ScrollPager class in an Objective-C project, the below function: public func addSegmentsWithTitlesAndViews(segments: [(title: String, view: UIView)]) doesn't appear in the header file created by xcode (addSegmentsWithTitles is included and works perfectly).

    Any idea why? Or if there's a turnaround to adding different/same subview in all scroll indexes ?

    Thank you

    screen shot 2015-04-29 at 4 27 24 pm

    opened by Krystel 2
  • Fix broken headings in Markdown files

    Fix broken headings in Markdown files

    GitHub changed the way Markdown headings are parsed, so this change fixes it.

    See bryant1410/readmesfix for more information.

    Tackles bryant1410/readmesfix#1

    opened by bryant1410 1
  • problem to change background color of scrollview

    problem to change background color of scrollview

    helllo

    in have a problem with this awesome library man ... my problem is when i use this library i cant change the background color of scrollview ... is this a issue or do you have any idea ????

    sorry for my bad english and thank you :)

    opened by mabebrahimi 1
  • Webview on each Page

    Webview on each Page

    Hi!

    I want to add a webview on each page, but how do I do this? So if you slide to the next page the next webview shows up. Swift is pretty new for me so it would be great if you could help me out with this problem :)

    Thanks!

    opened by MacBookOSX 1
  • Fixed Problem with orientation change and supported Swift 5

    Fixed Problem with orientation change and supported Swift 5

    fix: #33

    • Fixed the orientation change issue by moving the procedures from scrollViewDidScroll to scrollViewDidEndDecelerating and recalculate the contentOffset in redrawComponents.

    • Supported Swift 5.

    • Updated Deployment Target to 9.0

    • Modified ScrollPager.podspec and .travis.yml

    opened by cafedeichi 2
  • menu have multi items

    menu have multi items

    i have a menu with multi items , and it' scale to fit screen. with alot .(dot) .... i want it slide like other tabbar .

    when i put scrollpage to a scrollview. it's work, but . the scroll not auto run to the item when i change the view.!

    opened by choioi 0
  • Problem with orientation change

    Problem with orientation change

    Hi, I have 4 views with Labels. When I change orientation the view is in wrong position (I think the scroll view is responsible for this).

    This is how it looks

    and from landscape to portrait

    I have managed to do some nasty hack with this code

    var lastIndex = 0
    
    func scrollPager(scrollPager: ScrollPager, changedIndex: Int) {
        print("scrollPager index changed: \(changedIndex)")
        lastIndex = changedIndex
    }
    
    override func willTransition(to newCollection: UITraitCollection, with coordinator: UIViewControllerTransitionCoordinator) {
        coordinator.animate(alongsideTransition: nil) { _ in
                
            self.scrollPager.setSelectedIndex(index: self.lastIndex, animated: false)
        }
    }
    

    It would be much better when selectedIndex property was public (the getter) than private because I wouldn't have to remember the index. Please fix this to scroll automatically to right view when orientation changes.

    opened by smamczak 3
Releases(0.8)
Owner
Aryan Ghassemi
Aryan Ghassemi
UITabBarController with swipe interaction between its tabs.

?? Features Zero setup Different animations Enable/Disable interactions easily Fluid gestures ?? Installation Using CocoaPods Edit your Podfile and sp

Marcos Griselli 1.4k Jan 7, 2023
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
Pager is the simplest and best way to implement sliding view controllers in Swift

Pager is the simplest and best way to implement sliding view controllers. Installation Drop in the Spring folder to your Xcode project. Or via CocoaPo

Lucas Oceano 234 Aug 5, 2022
Smooth customizable tabs for iOS apps.

SmoothTab Requirements iOS 11.0+ Swift 5.x Xcode 10+ Installation CocoaPods pod 'SmoothTab' How to use Complete screen To setup and customize the comp

Yervand Saribekyan, iOS Dev 105 Feb 13, 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
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
KYWheelTabController is a subclass of UITabBarController.It displays the circular menu instead of UITabBar.

KYWheelTabController KYWheelTabController is a subclass of UITabBarController.It displays the circular menu instead of UITabBar. Installation CocoaPod

kyo__hei 121 Oct 10, 2022
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
Another UITabBar & UITabBarController (iOS Tab Bar) replacement, but uses Auto Layout for arranging it's views hierarchy.

GGTabBar GGTabBar is a simple UITabBar & UITabBarController replacement that uses Auto Layout for constructing the GUI. I created it for curiosity, bu

Nicolas Goles 157 Sep 26, 2022
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
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
Swipeable Views with Tabs (Like Android SwipeView With Tabs Layout)

SMSwipeableTabView [![CI Status](http://img.shields.io/travis/Sahil Mahajan/SMSwipeableTabView.svg?style=flat)](https://travis-ci.org/Sahil Mahajan/SM

Sahil Mahajan 57 Sep 9, 2022
Finds the .dSYM for a given binary image name and replaces its internal UUID with the given UUID.

dsymrename Given a directory with several .dSYMs, finds the .dSYM for a given binary image name and replaces its internal UUID with the given UUID. Us

Stefan Schmitt 15 Jul 17, 2022
A swift package(SPM) with iOS UI component that loads and displays images from remote urls or local assets and displays in a slide-show form with auto scroll feature.

MDBannersView A swift package with an iOS UI component that loads and displays images from remote urls, local assets and displays in a slide-show form

Madhav Deva 2 Feb 5, 2022
Inspired by Fabric - Answers animation. Allows to "build" given view with pieces. Allows to "destroy" given view into pieces

ADPuzzleAnimation Whats inside Custom animation for UIView inspired by Fabric - Answers animation. Easy to use To create your first animation you need

Anton 126 Dec 25, 2022
CloudCore is a framework that manages syncing between iCloud (CloudKit) and Core Data written on native Swift.

CloudCore CloudCore is a framework that manages syncing between iCloud (CloudKit) and Core Data written on native Swift. Features Leveraging NSPersist

deeje cooley 123 Dec 31, 2022
UITabBarController with swipe interaction between its tabs.

?? Features Zero setup Different animations Enable/Disable interactions easily Fluid gestures ?? Installation Using CocoaPods Edit your Podfile and sp

Marcos Griselli 1.4k Jan 7, 2023
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 paging menu controller built from other view controllers placed inside a scroll view (like Spotify, Windows Phone, Instagram)

Unfortunately, life gets in the way sometimes and I won't be able to maintain this library any longer and upgrade this library to where it needs to be

null 5.2k Dec 31, 2022
A paging scroll view for SwiftUI, using internal SwiftUI components

PagingView A paging scroll view for SwiftUI, using internal SwiftUI components. This is basically the same as TabView in the paging mode with the inde

Eric Lewis 18 Dec 25, 2022