Latest2.0.0
Homepagehttps://github.com/mevalid/FATabScroller
LicenseMIT
Platformsios 9.0
DependenciesFont-Awesome-Swift, SCLayout
Authors

The FATabScroller is a completely customizable widget with set of layered pages where only one page is displayed at a time.

FATabScroller

Requirements

  • Xcode 8.0+
  • Swift 3.0+

Installation

FATabScroller is available through CocoaPods. You can install it with the following command:

$ gem install cocoapods
platform :ios, '9.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'FATabScroller', '~> 1.0.0'
end

Then, run the following command:

$ pod install

Usage

Properties

  • tabBarBackgroundColor {UIColor} – Background color of the tabbar.
  • tabBarColor {UIColor} – The color of the bar icon.
  • animate {Bool} – Indicates that card scrolling is enabled/disabled.

Events

  • beforeTabChange – Fires before a tab change. Return false to cancel the tabchange.
  • tabChange – Fires when a new tab has been activated.

Example

import FATabScroller
import Font_Awesome_Swift

class ViewController: UIViewController, FATabPanelDelegate {

    let tabPanel: FATabPanel = {
        let v = FATabPanel()
        v.tabBarBackgroundColor = UIColor.orange
        v.tabBarColor = UIColor.white
        return v
    }()

    override func viewDidLoad() {
        super.viewDidLoad()

        // Delegation
        tabPanel.shared = self

        view.addSubview(tabPanel)

        tabPanelConfig()
        layout()
    }

    func layout() {
        tabPanel.constraintsStretch()
    }

    func tabPanelConfig() {
        let view1 = UIView(), view2 = UIView(), label1 = UILabel(), label2 = UILabel()

        label1.text = "View 1"
        label2.text = "View 2"

        label1.addSCConstraints { sc in
            view1.addSubview(sc)
            sc.constraintWithAttribute(to: view1, attribute: .center)
        }

        label2.addSCConstraints { sc in
            view2.addSubview(sc)
            sc.constraintWithAttribute(to: view2, attribute: .center)
        }

        tabPanel.items = [
            FATabPanelItem(title: .FAHome, card: view1),
            FATabPanelItem(title: .FAMap, card: view2)
        ]
    }

    // MARK: FATabPanelDelegate
    func beforeTabChange() -> Bool {
        print("beforetabchange event")
        return true
    }

    func tabChange() {
        print("ontabchange event")
    }
}

License

FATabScroller is released under the MIT license. See LICENSE for details.

Latest podspec

{
    "name": "FATabScroller",
    "version": "2.0.0",
    "summary": "A basic tab container.",
    "description": "The FATabScroller is a completely customizable widget with set of layered pages where only one page is displayed at a time.",
    "homepage": "https://github.com/mevalid/FATabScroller",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Mirela": "[email protected]"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/mevalid/FATabScroller.git",
        "tag": "2.0.0"
    },
    "source_files": [
        "FATabScroller",
        "FATabScroller/**/*.{h,m}"
    ],
    "pod_target_xcconfig": {
        "SWIFT_VERSION": "3"
    },
    "dependencies": {
        "Font-Awesome-Swift": [
            "~> 1.6.4"
        ],
        "SCLayout": [
            "~> 2.0.1"
        ]
    }
}

Pin It on Pinterest

Share This