Giter Club home page Giter Club logo

navigationmenu's Introduction

Navigation Menu for iOS

Version 1.0

Navigation Menu is an Objective-C component that adds possibility to show menu from navigation bar. Inspired by Vkontakte app. Minimum iOS target is 5.0

Customization

  • Menu item height + (float)itemCellHeight;
  • Animation duration of menu appearence + (float)animationDuration;
  • Menu substrate alpha value + (float)backgroundAlpha;
  • Menu alpha value + (float)menuAlpha;
  • Value of bounce + (float)bounceOffset;
  • Arrow image near title *+ (UIImage )arrowImage;
  • Distance between Title and arrow image + (float)arrowPadding;
  • Items color in menu *+ (UIColor )itemsColor;
  • Menu color *+ (UIColor )mainColor;
  • Item selection animation speed + (float)selectionSpeed;
  • Menu item text color *+ (UIColor )itemTextColor;
  • Selection color (will create a gradiend with provided color at the top and 35% darker in the bottom) *+ (UIColor )selectionColor;

Example

//In your header (.h) file
#import "SINavigationMenuView.h"

@interface HAViewController : UIViewController <SINavigationMenuDelegate>

@end

//In your implementation (.m) file
- (void)viewDidLoad
{
	[super viewDidLoad];
	// check if we have a navigationItem
	if (self.navigationItem) {
    	CGRect frame = CGRectMake(0.0, 0.0, 200.0, self.navigationController.navigationBar.bounds.size.height);
    	SINavigationMenuView *menu = [[SINavigationMenuView alloc] initWithFrame:frame title:@"Menu"];
    	//Set in which view we will display a menu
    	[menu displayMenuInView:self.view];
    	//Create array of items
    	menu.items = @[@"News", @"Top Articles", @"Messages"];
    	menu.delegate = self;
    	self.navigationItem.titleView = menu;
	}
}

//Delegate method
- (void)didSelectItemAtIndex:(NSUInteger)index
{
	NSLog(@"did selected item at index %d", index);
}

You will need to add QuartzCore framework. This component use ARC. For cusomization see SIMenuConfiguration .h/.m files.

navigationmenu's People

Contributors

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