Giter Club home page Giter Club logo

fsverticaltabbarcontroller's Introduction

Overview

This project aims to replicate UITabBarController functionality and behavior, but with a vertical tab bar.

There's no controller for customizing the tab bar in runtime (aka "More" tab), instead the tab bar can accommodate an "infinite" number of tabs because it's a UITableView under the hood (but the scrolling is automatically turned off if it's not necessary).

While some may find it production ready there's still many things that can be added/improved/(fixed), thus all contributions are welcomed. Here's a sneak peek at how it looks like with 120px with tab bar and a textured image as background.

Currently includes a sample Universal project that will run on iPad and iPhone. Basic usage is as follows:

FSVerticalTabBarController * tc = [[FSVerticalTabBarController alloc] init];
//Create the first view controller
FSViewController * vc = [[FSViewController alloc] init];
//Create tabItem for the view controller
vc.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"tab 1" image:[UIImage imageNamed:@"magnifying-glass.png"] tag:0];
//create another view controller
FSViewController * vc1 = [[FSViewController alloc] init];
//change background color of second view to differentiate
[vc1.view setBackgroundColor:[UIColor blueColor]];
vc1.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"tab 2" image:[UIImage imageNamed:@"magnifying-glass.png"] tag:1];
//set the view controllers of the the tab bar controller
[tc setViewControllers:[NSArray arrayWithObjects:vc,vc1, nil]];
//set one view controller to be selected
[tc setSelectedViewController:vc];
//set the background color to a texture
[[tc tabBar] setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"ios-linen.png"]]];
//now add the TabBarController to the window as the root controller
[[self window] setRootViewController:tc];
[[self window] makeKeyAndVisible];

Requirements:

  • iOS5 or above
  • Automatic Reference Counting

TODO:

  • add tab bar gradient drawing (currently one can only use images)
  • add more delegate methods
  • add (better) sample code
  • test it with Interface Builder (do we need it? :)
  • probably many other

fsverticaltabbarcontroller's People

Contributors

jstart avatar bejo avatar rbellec avatar moriquendi avatar m1entus avatar nelanelanela avatar greggs avatar macbuildserver avatar ecaselles avatar

Watchers

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