Latest 1.0.1
Homepage https://github.com/ioscodigo/ICTabFragment
License MIT
Platforms ios 9.0, requires ARC
Frameworks UIKit
Authors

Tab menu with page view controller


Minimum Requirements

iOS9+
Swift 3.0
XCode 8.0

Installation

Using CocoaPods

pod 'ICTabFragment'

Usage

  1. Create ViewController and also ViewController class (Parent ViewController)
  2. Add UIView that will use as tab menu bar
  3. Add UIView that will use as container child ViewController
  4. Create child ViewController (more than 1 ViewController) don’t forget to set identifier of each ViewController
  5. Import ICTabFragment to use ICTabFragment in your file.

Example

import UIKit
import ICTabFragment

class ViewController: UIViewController {
    @IBOutlet weak var tabView: UIView!
    @IBOutlet weak var containerView: UIView!

    override func viewDidLoad() {
        super.viewDidLoad()

        let tabs = [
            ICTabModel(tabName: "One", tabView: storyboard?.instantiateViewController(withIdentifier: "FirstViewController") as! FirstViewController),
            ICTabModel(tabName: "Two", tabView: storyboard?.instantiateViewController(withIdentifier: "SecondViewController") as! SecondViewController),
            ICTabModel(tabName: "Three", tabView: storyboard?.instantiateViewController(withIdentifier: "ThirdViewController") as! ThirdViewController)
        ]

        let tabFragment = ICTabFragmentViewController(context: self, tabs: tabs, tabView: viewTest, containerView: containerTest)
        tabFragment.create()
    }
}

Custom Properties

If you want to custom tab menu then you can set properties before create method was called

    open var textColorSelected: UIColor

    open var textColorUnselected: UIColor

    open var indicatorColorSelected: UIColor

    open var indicatorHeight: CGFloat

    open var indicatorTopSpace: CGFloat

    open var textFont: UIFont

    open var tabSize: ICTabSize

    open var tabFitSize: CGFloat

    open var tabLineSpacing: CGFloat

    open var tabInterSpacing: CGFloat

then call create method

    tabFragment.create()

Delegate

you can call delegate to get current view on containerview

    tabFragment.delegate = self

    extension ViewController: ICTabFragmentDelegate {
        func currentViewController(_ viewController: UIViewController) {
            /*
            *   Define your logic here
            */
        }
    }

Author

2017, Digital Khrisna Aurum, [email protected]

License

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

Latest podspec

{
    "name": "ICTabFragment",
    "platforms": {
        "ios": "9.0"
    },
    "summary": "Tab menu with page view controller",
    "requires_arc": true,
    "version": "1.0.1",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Digital Khrisna": "[email protected]"
    },
    "homepage": "https://github.com/ioscodigo/ICTabFragment",
    "source": {
        "git": "https://github.com/ioscodigo/ICTabFragment.git",
        "tag": "1.0.1"
    },
    "frameworks": "UIKit",
    "source_files": "ICTabFragment/**/*.{swift}",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This