TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Sep 2017 |
SwiftSwift Version | 4.0 |
SPMSupports SPM | ✗ |
Maintained by Dario Trisciuoglio.
A TabLayoutView
object is a horizontal control made of multiple tabs, each tab functioning as a discrete button.
To run the example project, clone the repo, and run pod install
from the Example directory first.
TabLayoutView
// Initialize the tab layout view
let origin = CGPoint(x: 0, y: 0)
let size = CGSize(width: 280, height: 44)
let frame = CGRect(origin:origin, size:size)
let tabLayoutView = TabLayoutView(frame: frame)
tabLayoutView.center = self.view.center
// Set the type
tabLayoutView.type = .normal
// Set the indicator position
tabLayoutView.indicatorPosition = .bottom
// Set the indicator color
tabLayoutView.indicatorColor = .red
// Set the font color
tabLayoutView.fontColor = .red
// Set the font selected color
tabLayoutView.fontSelectedColor = .black
// Set the items
tabLayoutView.items = ["Test A", "Test B", "Test C", "Test D", "Test E", "Test F", "Test G", "Test H", "Test I", "Test L"]
// Set the delegate
tabLayoutView.delegate = self
// Add it as a subview
self.view.addSubview(tabLayoutView)
Also support xib and storyboard
CocoaPods
Dario Trisciuoglio
TabLayoutView is available under the MIT license. See the LICENSE file for more info.