Skip to content

A horizontal menu for iOS apps that easily adds the horizontal menu in the top of iOS app

Notifications You must be signed in to change notification settings

sandeepjangir/SJHorizontalMenu

Repository files navigation

SJHorizontalMenu

A horizontal menu for iOS apps that easily adds the horizontal menu in the top of iOS app

A simple, horizontally-scrolling list of items that can be used as a more flexible replacement for UISegmentedControl

##Usage ###Setup and Initialization

#import "SJHorizontalMenu.h"

The horizontal selection list uses a data-source/delegate model (similar to UITableView or UIPickerView). To setup a simple horizontal selection list, init the view and set it's delegate and data source:

@interface YourViewControllerClass () <SJHorizontalMenuDataSource, SJHorizontalMenuDelegate>


- (void)viewDidLoad {
	[super viewDidLoad];

	horizontalMenu = [[SJHorizontalMenu alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 40)];
  horizontalMenu.delegate = self;
  horizontalMenu.dataSource = self;

	
}


#pragma -mark SJHorizontalMenu

- (NSInteger)numberOfItemsInSelectionMenu:(SJHorizontalMenu *)selectionList {
    return menuItemsName.count;
}

- (NSString *)selectionList:(SJHorizontalMenu *)selectionList titleForItemWithIndex:(NSInteger)index {
    return menuItemsName[index];
}

- (void)selectionList:(SJHorizontalMenu *)selectionMeu didSelectButtonWithIndex:(NSInteger)index {
    //anything
}

About

A horizontal menu for iOS apps that easily adds the horizontal menu in the top of iOS app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published