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.
##there are two styles of worm tab strip:
- Bubble style:
- Line style:
XCode 7.3.1 & 8.1 beta 4
Swift 2.3 & Swift 3
coming soon
- Download and drop
WormTabStrip.swift
andWormTabStripButton.swift
in your project. - Congratulations!
checkout brach swift3
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)
viewPager.delegate = self
self.view.addSubview(viewPager)
viewPager.buildUI()
checkout [WormTabStripStylePropertyies] (https://github.com/EzimetYusup/WormTabStrip/blob/master/WormTabStrip/WormTabStrip/WormLib/WormTabStrip.swift#L32) 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()
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 |
Bagdax News, screen shots:
We would love for you to contribute to WormTabStrip, check the LICENSE
file for more info.
Ezimet Yusup – Github –
Distributed under the MIT license. See LICENSE
for more information.