πŸ› WormTabStrip ViewPager for iOS written in Swift, which gives continuous feedback to the user when scrolling

Overview

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 up by two scroll view, one at the top for holding all the tabs, one for content view for each tab. frame based, not auto layout constraint based.

Swift Version Swift Version License Platform

there are two styles of worm tab strip:

  • Bubble style:

alt text

  • Line style:

alt text

Current example build environment

XCode 11.4

Swift 5

Installation

CocoaPods

pod 'WormTabStrip', '~> 1.0'

Manually

  1. Download and drop WormTabStrip.swift and WormTabStripButton.swift in your project.
  2. Congratulations!

Looking for swift 2.3?

checkout brach swift2.3

Usage example

implement the WormTabStripDelegate in your UIViewController then do

let frame =  CGRect(x: 0, y: 40, width: self.view.frame.size.width, height: self.view.frame.size.height - 40)
let viewPager:WormTabStrip = WormTabStrip(frame: frame)
self.view.addSubview(viewPager) //IMPORTANT!
viewPager.delegate = self
viewPager.eyStyle.wormStyel = .bubble
viewPager.eyStyle.isWormEnable = true
viewPager.eyStyle.spacingBetweenTabs = 15
viewPager.eyStyle.dividerBackgroundColor = .red
viewPager.eyStyle.tabItemSelectedColor = .yellow
//default selected tab
viewPager.currentTabIndex = 3
//center the selected tab
viewPager.shouldCenterSelectedWorm = true
viewPager.buildUI()

Need custom style?

checkout WormTabStripStylePropertyies struct, give your custom style

viewPager.eyStyle.wormStyel = .line
viewPager.eyStyle.isWormEnable = false
viewPager.eyStyle.spacingBetweenTabs = 15
viewPager.eyStyle.dividerBackgroundColor = .red
viewPager.eyStyle.tabItemSelectedColor = .yellow
...

before you you call

viewPager.buildUI() 

Available customization properties

Property Description
wormStyel style of the worm bubble or line
kHeightOfWorm worm height for line style
kHeightOfWormForBubble worm height for bubble style
kHeightOfDivider divider height between top scrollview and conent scrollview
kHeightOfTopScrollView Top scrollView height which hold all tabs
kMinimumWormHeightRatio minimum worm height Ratio, it should be less than 1
kPaddingOfIndicator Padding of tab button, from text to button each side
spacingBetweenTabs space between tab buttons
isWormEnable boolean, if false it will not animate worm
tabItemDefaultFont font for unSelected tab
tabItemSelectedFont font for selected tab
tabItemDefaultColor text color for unSelected tab
tabItemSelectedColor text color for selected tab
WormColor color for worm
topScrollViewBackgroundColor back ground color of top scroll view which hold all tabs
contentScrollViewBackgroundColor back ground color fo content scroll view
dividerBackgroundColor back ground color of divider view between top scroll view and content scroll view

Apps using worm tab strip:

Bagdax News, screen shots:

alt text

Contribute

We would love for you to contribute to WormTabStrip, check the LICENSE file for more info.

Meta

Ezimet Yusup – Github –

Distributed under the MIT license. See LICENSE for more information.

Comments
  • How can i use tableview controller and cell  inside App  ?

    How can i use tableview controller and cell inside App ?

    @EzimetYusup Thanks for giving library! i need to populating tableview data. func WTSviewOfTab(index: Int) -> UIView { let view:LeaveTableVC = LeaveTableVC() if index == 0 { view.view.backgroundColor = UIColor.black }

    self.tableview.delegate = self
        self.tableview.dataSource = self,  `
    

    Error: fatal error: unexpectedly found nil while unwrapping an Optional value

    I was getting tableview.delegate = self (in leavetableVC class) Please help me out this issue

    opened by IOSDeveloperProgrammer 3
  • Better Readme

    Better Readme

    Hey, your library is really interesting.

    The only problem I found was the README.md, which lacks information. I created this iOS Open source Readme Template so you can take a look on how to better organize. If you want, I can help you to do it.

    What are your thoughts?

    opened by lfarah 3
  • Method to identify the tab click.

    Method to identify the tab click.

    In my case, I just have one view controller with table view and I want to reload the table view.

    Is there any method to identify the tab click so that I can reload the tableview?

    @EzimetYusup

    opened by sathamkhussain 1
  • How to call viewWillAppear while change tab

    How to call viewWillAppear while change tab

    How to call viewWillAppear of selected viewController whenever tabBar button pressed or scrollView swiped.

    By default viewWillAppear not triggered after used this library.

    @EzimetYusup

    opened by rajesh-loganathan 1
  • Tableview Disappears

    Tableview Disappears

    Hi, I'm loving WormTabStrip but I ran into a problem when I add in a tableview's view. The tableview seems to completely disappear whenever I touch it.

    My tableview controller works fine when it's not under a tab so I'm not sure what could cause it to disappear under WormTabStrip

    opened by kennyDang 1
  • Worm Tab Title Size

    Worm Tab Title Size

    Please initialize Fount in WormTabStripButton also , because if you don't initialize then font and size will not reflect first time so i use -> self.font = AppTheme.TabStripFont() class WormTabStripButton: UILabel{

    var index:Int?
    var paddingToEachSide:CGFloat = 10
    var tabText:NSString?{
        didSet{
            let textSize:CGSize = tabText!.size(withAttributes: [NSAttributedStringKey.font: font])
            self.frame.size.width = textSize.width + paddingToEachSide + paddingToEachSide
            
            self.text = String(tabText!)
        }
    }
    //MARK: init
    override init(frame: CGRect) {
        super.init(frame: frame)
        self.font = AppTheme.TabStripFont()
    }
    convenience required init(key:String) {
        self.init(frame:CGRect.zero)
        self.font = AppTheme.TabStripFont()
    }
    
    
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
        
    }
    

    }

    enhancement 
    opened by piyushkb 0
Owner
EzimetYusup
Mobile developer
EzimetYusup
This is a Review posting app that let user find interesting places near them

ColorMatchTabs Inspired by this project on Dribbble Also, read how it was done in our blog Installation CocoaPods pod 'ColorMatchTabs' Carthage github

Yalantis 1.4k Dec 5, 2022
ESTabBarController is a highly customizable TabBarController component, which is inherited from UITabBarController.

ESTabBarController is a highly customizable TabBarController component, which is inherited from UITabBarController. Why? In real-world developmen

Vincent Li 4.9k Jan 5, 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
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
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
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
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
A fun, easy-to-use tab bar navigation controller for iOS.

CircleBar Don’t you, sometimes, miss fun user interfaces? Truth is, we do. Sure, you can't use them in enterprise apps for obvious reasons, but if you

softhaus 786 Dec 25, 2022
A custom tab bar controller for iOS.

ESTabBarController ESTabBarController is a custom tab bar controller for iOS. It has a tab indicator that moves animated along the bar when switching

null 122 Oct 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
Android PagerTabStrip for iOS.

XLPagerTabStrip Made with ❀️ by XMARTLABS. Android PagerTabStrip for iOS! ?? Looking for a SwiftUI version? Check out PagerTabStripView, it's fully wr

xmartlabs 6.8k Jan 3, 2023
Customisable iOS bottom menu works like Tabbar

SSCustomTabMenu Simple customizable iOS bottom menu works like Tabbar, in Swift. Features Simple and customizable iOS Tab Menu items, in Swift. Requir

Simform Solutions 81 Aug 3, 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
iOS Top Tab Navigation

iOS-Top-Tab-Navigation Good news for all our users out there! Now there are no boundaries to your convenience, you can pass as much words as you want

MindInventory 14 Aug 3, 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
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
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
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