Code Monkey home page Code Monkey logo

ictabfragment's Introduction

ICTabFragment

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()

Author

2017, Digital Khrisna Aurum, [email protected]

License

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

ictabfragment's People

Contributors

digitkhrisnaa avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.