TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Sep 2015 |
Maintained by Enric Macias Lopez.
Implements a scrollable view with buttons in it. Offers different delegate methods to use it as a menu bar and some design and animation customization.
Check the example project in the "Example" folder.
Create a UIView in Interface Builder with EMLMenuBar as a class. (The buttons will have the height of this view)
Adopt EMLMenuBarDataSource and EMLMEnuBarDelegate into your UIViewController.
@interface EMLMainViewController : UIViewController <EMLMenuBarDelegate, EMLMenuBarDataSource>
Assign the delegate and datasource to your UIViewController.
Implement the EMLMenuBarDataSource and its required methods:
- (NSUInteger)itemCountInMenuBar:(EMLMenuBar *)menuBar;
- (NSString *)itemTitleAtIndex:(NSUInteger)index inMenuBar:(EMLMenuBar *)menuBar;
Implement the EMLMEnuBarDelegate and its required method:
- (void)itemSelectedAtIndex:(NSUInteger)index inMenuBar:(EMLMenuBar *)menuBar;
Choose one of the three types of button alineation:
EMLMenuBarStyleNone (Default). The width is the one set in EMLMenuBarDataSource.
Modify the button design through interface builder with EMLMenuBarButton xib file:
EMLMenuBarButton.xib
- (void)appearanceForNormalStateMenuBarButton:(EMLMenuBarButton *)barButton;
- (void)appearanceForSelectedStateMenuBarButton:(EMLMenuBarButton *)barButton;
Import the following files into your project:
EMLMenuBar/Pod/Classes folder:
EMLMenuBar.h
EMLMenuBar.m
EMLMenuBarButton.h
EMLMenuBarButton.m
EMLMenuBarDataSource.h
EMLMenuBarDelegate.h
EMLMenuBar/Pod/Resources folder:
EMLMenuBarButton.xib
enric.macias.lopez, [email protected]
EMLMenuBar is available under the MIT license. See the LICENSE file for more info.