Giter Site home page Giter Site logo

dotabbar's Introduction

DOTabbar

DOTabbar is a lightweight and customizable tab bar control with support for grouping items for Mac OSX.

It's compatiable with OSX 10.7+ and autolayout ready.

Ussage

Don't forget to check out an example project.

Copy files

You need to copy the following files to your project:

  • DOTabbar.h
  • DOTabbar.m
  • DOTabbarItemCell.h
  • DOTabbarItemCell.m

Make sure to add them to the target.

Use in project

You can use DOTabbar in Inteface Builder: just drag a Custom View into your window and set it class to DOTabbar. After that you need to set a delegate to your tab bar and implement it.

Your delegate must adopt DOTabbarDelegate protocol:

@protocol DOTabbarDelegate <NSObject>
	// Your groups identifiers
	- (NSArray *)tabbarGroupIdentifiers:(DOTabbar *)tabbar;
		
	// Item identifiers for each group
	- (NSArray *)tabbar:(DOTabbar *)tabbar itemIdentifiersForGroupIdentifier:(NSString *)identifier;
		
	// Cell for each item 
	- (NSCell *)tabbar:(DOTabbar *)tabbar cellForItemIdentifier:(NSString *)itemIdentifier;
		
	@optional
		
	// Title for group. Can be empty
	- (NSString *)tabbar:(DOTabbar *)tabbar titleForGroupIdentifier:(NSString *)identifier;
		
	// Informs delegate that new item was selected
	- (void)tabbar:(DOTabbar *)tabbar didSelectItemWithIdentifier:(NSString *)identifier;
@end

Customizing

For customizing tab bar you can create your custom NSCell subclass and return it in your delegate tabbar:cellForItemIdentifier: method.

Requirements

DOTabbar uses ARC.

License

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

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.