CocoaPods trunk is moving to be read-only. Read more on the blog, there are 17 months to go.

TabLayoutView 1.0.2

TabLayoutView 1.0.2

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Sep 2017
SwiftSwift Version 4.0
SPMSupports SPM

Maintained by Dario Trisciuoglio.



  • By
  • Dario Trisciuoglio

TabLayoutView

A TabLayoutView object is a horizontal control made of multiple tabs, each tab functioning as a discrete button.

Usage

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

Requirements

  • iOS 9.0+
  • Xcode 8.3.3
  • Swift 3.0+

Installation

CocoaPods

Author

Dario Trisciuoglio

License

TabLayoutView is available under the MIT license. See the LICENSE file for more info.