Giter Site home page Giter Site logo

shawn-wangdapeng / containerviewcontroller Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jiangteng/containerviewcontroller

0.0 2.0 0.0 293 KB

swift ContainerViewController

License: MIT License

Ruby 2.61% Swift 56.02% Objective-C 2.75% Shell 38.62%

containerviewcontroller's Introduction

ContainerViewController

CI Status Version License Platform

About

With the swift implementation ContainerViewController.

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • Xcode 7.3+
  • iOS 8.0+
  • Swift 2.2+

Installation

ContainerViewController is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "ContainerViewController"

Usage

    let sampleVC1:UIViewController = UIViewController()
    sampleVC1.title = "sampleVC1"
    sampleVC1.view.backgroundColor = UIColor.blueColor()
    
    let sampleVC2:UIViewController = UIViewController()
    sampleVC2.title = "sampleVC2"
    
    let sampleVC3:UIViewController = UIViewController()
    sampleVC3.title = "sampleVC3"
    sampleVC3.view.backgroundColor = UIColor.redColor()
    
    let sampleVC4:UIViewController = UIViewController()
    sampleVC4.title = "sampleVC4"
            
    // ContainerView
    let statusHeight:CGFloat = UIApplication.sharedApplication().statusBarFrame.height
    let navigationHeight:CGFloat = (self.navigationController?.navigationBar.frame.height)!
    
    
    let contaninerVC = TNContainerViewController.init(controllers: [playListVC,artistVC,sampleVC1,sampleVC2,sampleVC3,sampleVC4,sampleVC5], topBarHeight: statusHeight + navigationHeight, parentViewController: self)
    contaninerVC.menuItemFont = UIFont.systemFontOfSize(16)
    contaninerVC.delegate = self
	contaninerVC.menuIndicatorColor = UIColor.redColor()
    contaninerVC.menuItemTitleColor = UIColor.purpleColor()
    contaninerVC.menuItemSelectedTitleColor = UIColor.yellowColor()        		
    self.view.addSubview(contaninerVC.view)

Property

contaninerVC.menuItemFont = UIFont.systemFontOfSize(16)
contaninerVC.menuBackGroudColor = UIColor.whiteColor()
contaninerVC.menuWidth = self.view.frame.width * 0.5 - 10.0
contaninerVC.indicatorHeight = 1.0
contaninerVC.menuViewHeight = 80
contaninerVC.menuIndicatorColor = UIColor.blueColor()
contaninerVC.menuItemTitleColor = UIColor.blackColor()
contaninerVC.menuItemSelectedTitleColor = UIColor.blueColor()        

To Do

log

0.1.2 add bottomHeight

0.1.1 custom menuview height and item width

0.1.0 init

Author

JiangTeng, [email protected]

License

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

MIT

containerviewcontroller's People

Contributors

jiangteng avatar shawn-wangdapeng avatar

Watchers

 avatar  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.